ci: switch to ubuntu-latest & revised matrixes
#55
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
| # Runs tests via tox | |
| # Runs on pull requests to main/master | |
| # Full Python matrix runs on push to main/master | |
| name: Test | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| push: | |
| branches: | |
| - main | |
| - master | |
| jobs: | |
| pr: | |
| # Pull requests: fast feedback on latest Python only | |
| name: PR (Python 3.12) | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| python-version: | |
| - "3.12" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Set up Python ${{ matrix.python-version }}" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "${{ matrix.python-version }}" | |
| - name: Install build meta-dependencies | |
| run: | | |
| pip install tox poetry tox-gh-actions | |
| - name: Test with tox | |
| run: | | |
| tox | |
| # - name: Coveralls Python | |
| # uses: AndreMiras/coveralls-python-action@v20201129 | |
| # with: | |
| # #github-token: #${{ secrets.GITHUB_TOKEN }} | |
| # github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true # optional (default = false) | |
| main: | |
| # Pushes to main/master: full Python matrix | |
| name: Main/Master (Python matrix) | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 1 | |
| matrix: | |
| python-version: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Set up Python ${{ matrix.python-version }}" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "${{ matrix.python-version }}" | |
| - name: Install build meta-dependencies | |
| run: | | |
| pip install tox poetry tox-gh-actions | |
| - name: Test with tox | |
| run: | | |
| tox | |
| # - name: Coveralls Python | |
| # uses: AndreMiras/coveralls-python-action@v20201129 | |
| # with: | |
| # #github-token: #${{ secrets.GITHUB_TOKEN }} | |
| # github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true # optional (default = false) | |
| # Legacy required check for branch protection. | |
| # NOTE: This does NOT run Python 3.9 tests; it exists only because branch protection | |
| # requires a status check named "build (3.9)". Remove once branch protection is updated. | |
| build_39: | |
| name: build (3.9) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Compatibility status | |
| run: | | |
| echo "Legacy required check for branch protection." | |
| # Legacy required checks for branch protection | |
| markdown_link_check: | |
| name: markdown-link-check | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check markdown links | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| args: > | |
| --verbose | |
| --no-progress | |
| --accept 200,206,429 | |
| --timeout 20 | |
| --max-concurrency 8 | |
| "**/*.md" |