Debian Codegraph @

.github/workflows/main.yml

raw
1 name: CI
2
3 on:
4 push:
5 branches:
6 - main
7 pull_request:
8
9 concurrency:
10 group: ${{ github.head_ref || github.run_id }}
11 cancel-in-progress: true
12
13 jobs:
14 tests:
15 name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
16 runs-on: ${{ matrix.os }}
17
18 strategy:
19 matrix:
20 os:
21 - ubuntu-24.04
22 - windows-2022
23 python-version:
24 - '3.9'
25 - '3.10'
26 - '3.11'
27 - '3.12'
28 - '3.13'
29
30 steps:
31 - uses: actions/checkout@v4
32
33 - uses: actions/setup-python@v5
34 with:
35 python-version: ${{ matrix.python-version }}
36 allow-prereleases: true
37
38 - name: Install uv
39 uses: astral-sh/setup-uv@v3
40 with:
41 enable-cache: true
42 cache-dependency-glob: tests/requirements/*.txt
43
44 - name: Install dependencies
45 run: uv pip install --system tox tox-uv
46
47 - name: Run tox targets for ${{ matrix.python-version }}
48 run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
49
50 - name: Upload coverage data
51 if: matrix.os != 'windows-2022'
52 uses: actions/upload-artifact@v4
53 with:
54 name: coverage-data-${{ matrix.python-version }}
55 path: '${{ github.workspace }}/.coverage.*'
56 include-hidden-files: true
57 if-no-files-found: error
58
59 coverage:
60 name: Coverage
61 runs-on: ubuntu-24.04
62 needs: tests
63 steps:
64 - uses: actions/checkout@v4
65
66 - uses: actions/setup-python@v5
67 with:
68 python-version: '3.12'
69
70 - name: Install uv
71 uses: astral-sh/setup-uv@v3
72
73 - name: Install dependencies
74 run: uv pip install --system coverage[toml]
75
76 - name: Download data
77 uses: actions/download-artifact@v4
78 with:
79 path: ${{ github.workspace }}
80 pattern: coverage-data-*
81 merge-multiple: true
82
83 - name: Combine coverage and fail if it's <100%
84 run: |
85 python -m coverage combine
86 python -m coverage html --skip-covered --skip-empty
87 python -m coverage report --fail-under=95
88 echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY
89 python -m coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
90
91 - name: Upload HTML report
92 if: ${{ failure() }}
93 uses: actions/upload-artifact@v4
94 with:
95 name: html-report
96 path: htmlcov