diff --git a/.github/workflows/pull-test.yml b/.github/workflows/pull-test.yml index 0292583..9c3aaaf 100644 --- a/.github/workflows/pull-test.yml +++ b/.github/workflows/pull-test.yml @@ -1,41 +1,130 @@ # Runs tests via tox -# Runs on pull requests to main -name: Test on pull request +# 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: - build: - runs-on: ubuntu-20.04 + 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: 3 + 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@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: "Set up Python ${{ matrix.python-version }}" - uses: actions/setup-python@v2 + 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@v1 + + - 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"