|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 12 | + |
| 13 | +jobs: |
| 14 | + ci: |
| 15 | + name: Test (Python ${{ matrix.python-version }}) |
| 16 | + runs-on: ubuntu-latest |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + python-version: |
| 21 | + - '3.10' |
| 22 | + - '3.11' |
| 23 | + - '3.12' |
| 24 | + - '3.13' |
| 25 | + - '3.14' |
| 26 | + steps: |
| 27 | + - name: 💾 Check out repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: 🪪 Configure git identity for tests |
| 31 | + run: | |
| 32 | + git config --global user.name "github-actions[bot]" |
| 33 | + git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 34 | +
|
| 35 | + - name: 🦀 Set up Python project with uv |
| 36 | + uses: astral-sh/setup-uv@v5 |
| 37 | + with: |
| 38 | + enable-cache: true |
| 39 | + python-version: ${{ matrix.python-version }} |
| 40 | + |
| 41 | + - name: 🐍 Install dependencies |
| 42 | + run: uv sync |
| 43 | + |
| 44 | + - name: 📐 Lint |
| 45 | + run: uv run poe lint |
| 46 | + |
| 47 | + - name: 🔥 Test |
| 48 | + run: uv run poe test |
| 49 | + |
| 50 | + - name: 🔍 Collect coverage results |
| 51 | + run: uv run coverage xml |
| 52 | + if: ${{ matrix.python-version == '3.14' }} |
| 53 | + |
| 54 | + - name: 📊 Upload coverage to Codecov |
| 55 | + uses: codecov/codecov-action@v6 |
| 56 | + if: ${{ matrix.python-version == '3.14' }} |
| 57 | + with: |
| 58 | + fail_ci_if_error: true |
| 59 | + |
| 60 | + docs: |
| 61 | + name: Documentation |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - name: 💾 Check out repository |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + fetch-depth: 0 |
| 68 | + |
| 69 | + - name: 🦀 Set up Python project with uv |
| 70 | + uses: astral-sh/setup-uv@v5 |
| 71 | + with: |
| 72 | + enable-cache: true |
| 73 | + python-version: '3.14' |
| 74 | + |
| 75 | + - name: 🐍 Install dependencies |
| 76 | + run: uv sync |
| 77 | + |
| 78 | + - name: 📖 Build documentation |
| 79 | + run: uv run poe docs-build |
| 80 | + |
| 81 | + gitleaks: |
| 82 | + name: Secret scan |
| 83 | + runs-on: ubuntu-latest |
| 84 | + permissions: |
| 85 | + contents: read |
| 86 | + steps: |
| 87 | + - name: 💾 Check out repository |
| 88 | + uses: actions/checkout@v4 |
| 89 | + with: |
| 90 | + fetch-depth: 0 |
| 91 | + |
| 92 | + - name: 🔍 Check for secrets |
| 93 | + uses: gitleaks/gitleaks-action@v2 |
| 94 | + env: |
| 95 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments