Skip to content

Commit

Permalink
Actions: update test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Mar 2, 2022
1 parent e9314f1 commit 3a6937d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
push:
branches: [master]
workflow_dispatch:

jobs:
test:
Expand All @@ -27,6 +28,8 @@ jobs:
- os: macos-latest
python-version: '3.9'
coverage: false
env:
PYTEST_ADDOPTS: -n 5 -m 'slow or not slow'
steps:

- name: Checkout repo
Expand All @@ -50,15 +53,21 @@ jobs:
env:
TZ: ${{ matrix.tz }}
run: |
PYTEST_ARGS=(-n 2 -m 'slow or not slow')
if ${{ matrix.coverage }}; then
PYTEST_ARGS+=('--cov=metomi/isodatetime')
PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --cov=metomi/isodatetime"
fi
pytest "${PYTEST_ARGS[@]}"
pytest
- name: Upload coverage report
- name: Coverage report
if: matrix.coverage
run: |
coverage xml --ignore-errors
bash <(curl -s https://codecov.io/bash)
coverage xml
coverage report
- name: Codecov upload
if: matrix.coverage
uses: codecov/codecov-action@v2
with:
name: '${{ matrix.os }} py-${{ matrix.python-version }}'
fail_ci_if_error: true

0 comments on commit 3a6937d

Please sign in to comment.