Update repo to use latest template, black formatting #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run code coverage | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| run-coverage: | |
| name: ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| # TODO handle forks | |
| # run pipeline on either a push event or a PR event on a fork | |
| # if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
| defaults: | |
| run: | |
| shell: bash | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }} | |
| cancel-in-progress: true | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| env: # used by codecov-action | |
| OS: ${{ matrix.os }} | |
| PYTHON: '3.13' | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # tags are required to determine the version | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON }} | |
| - name: Install package and test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # force upgrade of all dependencies to latest versions within allowed range | |
| python -m pip install -U ".[test]" | |
| python -m pip list | |
| python -m pip check | |
| - name: Run tests and generate coverage report | |
| run: | | |
| pytest --cov --cov-report=xml --cov-report=term # codecov uploader requires xml format | |
| # TODO uncomment after setting up repo on codecov.io and adding token | |
| # - name: Upload coverage to Codecov | |
| # uses: codecov/codecov-action@v4 | |
| # with: | |
| # fail_ci_if_error: true | |
| # file: ./coverage.xml | |
| # env: | |
| # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |