Repository navigation
71 lines (64 loc) · 1.75 KB
/
Copy pathci.yml
File metadata and controls
71 lines (64 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7.0.1
- uses: astral-sh/setup-uv@v10.4.0
with:
enable-cache: true
python-version: "3.10"
- run: uv sync --frozen --all-extras
- run: uv run ruff check src/ tests/
- run: uv run ruff format --check src/ tests/
typecheck:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7.0.1
- uses: astral-sh/setup-uv@v10.4.0
with:
enable-cache: true
python-version: "3.10"
- run: uv sync --frozen --all-extras
- run: uv run mypy src/
- run: uv run pyright src/
test:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v7.0.1
- uses: astral-sh/setup-uv@v10.4.0
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- run: uv sync --frozen --all-extras
- run: uv run pytest -q
ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [lint, typecheck, test]
if: always()
steps:
- env:
HAS_FAILURE: ${{ contains(needs.*.result, 'failure') }}
HAS_CANCELLED: ${{ contains(needs.*.result, 'cancelled') }}
run: |
if [[ "$HAS_FAILURE" == "true" || "$HAS_CANCELLED" == "true" ]]; then
echo "One or more jobs failed or were cancelled"
exit 1
fi