python-benedict/.github/workflows/test-package.yml

51 lines
1.1 KiB
YAML
Raw Normal View History

name: Test package
2019-12-12 17:38:52 +00:00
2021-12-08 15:53:07 +00:00
on:
2022-01-27 22:15:41 +00:00
push:
pull_request:
workflow_dispatch:
2019-12-12 17:38:52 +00:00
jobs:
build:
2021-12-08 15:53:07 +00:00
runs-on: ubuntu-latest
2019-12-12 17:38:52 +00:00
strategy:
2022-01-17 21:10:30 +00:00
fail-fast: false
2019-12-12 17:38:52 +00:00
matrix:
2022-01-12 00:45:41 +00:00
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
2019-12-12 17:38:52 +00:00
steps:
2021-12-08 15:53:07 +00:00
2022-02-17 20:24:34 +00:00
- uses: actions/checkout@v2
2021-12-08 15:53:07 +00:00
2019-12-12 17:38:52 +00:00
- name: Set up Python ${{ matrix.python-version }}
2021-12-08 15:53:07 +00:00
uses: actions/setup-python@v2
2019-12-12 17:38:52 +00:00
with:
python-version: ${{ matrix.python-version }}
2021-12-07 20:05:57 +00:00
cache: 'pip'
2021-12-08 15:53:07 +00:00
2019-12-12 17:38:52 +00:00
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
2021-12-06 17:30:11 +00:00
pip install -r requirements-test.txt
2022-02-14 19:53:10 +00:00
# # fails on python 2.7
# - name: Run tests
# run: |
# coverage run --append -m unittest
# coverage xml -o ./coverage.xml
2021-12-08 15:53:07 +00:00
2022-01-12 00:45:41 +00:00
- name: Run tests
2022-02-14 19:53:10 +00:00
run: |
2022-02-14 22:32:28 +00:00
coverage run --append --source=benedict setup.py test
2022-02-14 19:53:10 +00:00
coverage xml -o ./coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
files: ./coverage.xml
flags: unittests
verbose: true