Bump actions/setup-python from 5 to 6 #3
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: CI/CD | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_COLOR: 1 | |
| PY_COLORS: 1 | |
| MYPY_FORCE_COLOR: 1 | |
| jobs: | |
| lint: | |
| name: Linter | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install -e . -r requirements/lint.txt -r requirements/test.txt | |
| - name: Run pre-commit | |
| run: | | |
| pre-commit run --all-files --show-diff-on-failure | |
| - name: Run mypy | |
| run: | | |
| mypy | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| id-token: write # tokenless (OIDC) coverage upload to Codecov | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| cache: pip | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip | |
| python -m pip install -e . -r requirements/test.txt | |
| - name: Run tests | |
| run: | | |
| pytest --cov=aiohttp_client_middlewares --cov-report=xml --cov-report=term | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| flags: unittests | |
| use_oidc: true | |
| fail_ci_if_error: false | |
| check: # This job does nothing and is only used for branch protection | |
| name: All green | |
| if: always() | |
| needs: [lint, test] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| build: | |
| name: Build distribution | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| needs: [check] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| cache: pip | |
| - name: Install build tooling | |
| run: | | |
| python -m pip install -U pip build | |
| - name: Build sdist and wheel | |
| run: | | |
| python -m build | |
| - name: Upload distribution artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| if-no-files-found: error | |
| publish-pypi: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| needs: [build] | |
| # Publish to PyPI only on tag pushes matching v*. | |
| if: >- | |
| github.event_name == 'push' | |
| && startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| id-token: write # IMPORTANT: mandatory for trusted publishing (OIDC) | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/aiohttp-client-middlewares | |
| steps: | |
| - name: Download distribution artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - name: Publish 🐍📦 to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| # Allow re-running the deploy job after a partial PyPI upload | |
| # without failing on dists that were already published. | |
| skip-existing: true |