diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 76d4794..0b3b156 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,7 @@ on: pull_request: push: branches: [master] + workflow_dispatch: jobs: test: @@ -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 @@ -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