ci: bump the github-actions group across 1 directory with 3 updates #35
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 | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
| PIP_NO_INPUT: "1" | |
| PYTHONIOENCODING: utf-8 | |
| PYTHONUTF8: "1" | |
| PYTHONUNBUFFERED: "1" | |
| jobs: | |
| repository: | |
| name: Repository policy | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.14" | |
| - name: Validate repository invariants | |
| run: python tools/validate_repository.py | |
| quality: | |
| name: Static quality | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.14" | |
| - name: Install project quality tools | |
| run: python -m pip install -e ".[dev]" | |
| - name: Check formatting | |
| run: python -m ruff format --check . | |
| - name: Lint source and tests | |
| run: python -m ruff check . | |
| - name: Check static types | |
| run: python -m mypy | |
| - name: Check documented consumer types | |
| run: python tools/typecheck_consumers.py | |
| tests: | |
| name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package | |
| run: python -m pip install . | |
| - name: Run unit and adversarial tests | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| python -m unittest discover -s tests -v 2>&1 | tee unittest.log | |
| - name: Upload test log | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: unittest-${{ runner.os }}-py${{ matrix.python-version }} | |
| path: unittest.log | |
| if-no-files-found: error | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.14" | |
| - name: Install package and coverage | |
| run: python -m pip install . coverage==7.15.2 | |
| - name: Measure branch coverage | |
| run: python -m coverage run -m unittest discover -s tests | |
| - name: Enforce coverage threshold | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| python -m coverage report -m | tee coverage.txt | |
| python -m coverage xml | |
| python -m coverage report --fail-under=95 | |
| - name: Upload coverage evidence | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: coverage-report | |
| path: | | |
| coverage.txt | |
| coverage.xml | |
| if-no-files-found: error | |
| package: | |
| name: Package integrity | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.14" | |
| - name: Install build frontend | |
| run: python -m pip install build==1.5.0 | |
| - name: Build wheel and source archive | |
| run: python -m build | |
| - name: Inspect distribution contents and metadata | |
| run: python tools/validate_dist.py dist | |
| - name: Install and exercise isolated wheel | |
| run: python tools/install_smoke.py dist | |
| - name: Validate isolated wheel consumers | |
| run: python tools/consumer_validation.py dist | |
| - name: Rebuild equivalent wheel from source archive | |
| run: >- | |
| python tools/rebuild_from_sdist.py dist | |
| - name: Upload validated distributions | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: validated-distributions | |
| path: dist/ | |
| if-no-files-found: error | |
| retention-days: 14 | |
| stress: | |
| name: Atomicity stress (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Check out source | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.14" | |
| - name: Install package | |
| run: python -m pip install . | |
| - name: Run concurrent reader and writer stress test | |
| run: python tools/stress_atomicity.py --writers 12 --replacements 80 --payload-size 96000 | |
| required: | |
| name: CI required | |
| if: always() | |
| needs: [repository, quality, tests, coverage, package, stress] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Enforce all required jobs | |
| env: | |
| REPOSITORY_RESULT: ${{ needs.repository.result }} | |
| QUALITY_RESULT: ${{ needs.quality.result }} | |
| TESTS_RESULT: ${{ needs.tests.result }} | |
| COVERAGE_RESULT: ${{ needs.coverage.result }} | |
| PACKAGE_RESULT: ${{ needs.package.result }} | |
| STRESS_RESULT: ${{ needs.stress.result }} | |
| run: | | |
| python - <<'PY' | |
| import os | |
| results = { | |
| name: os.environ[f"{name.upper()}_RESULT"] | |
| for name in ("repository", "quality", "tests", "coverage", "package", "stress") | |
| } | |
| failed = {name: result for name, result in results.items() if result != "success"} | |
| if failed: | |
| raise SystemExit(f"required jobs did not pass: {failed}") | |
| print("all required CI jobs passed") | |
| PY |