-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (106 loc) · 3.42 KB
/
Copy pathci.yml
File metadata and controls
126 lines (106 loc) · 3.42 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
# Cancel in-progress runs when a new workflow with the same group name is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Detect if code changes warrant full CI run
changes:
runs-on: ubuntu-latest
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
code:
- '!docs/**'
- '!mkdocs.yml'
- '!*.md'
- '!LICENSE'
- '!.github/copilot-instructions.md'
- '!.github/pull_request_template.md'
- '!.github/agents/**'
- '!.github/instructions/**'
- '!.github/prompts/**'
test:
needs: changes
runs-on: ubuntu-latest
strategy:
fail-fast: false # Don't cancel other matrix jobs if one fails
matrix:
python-version: ["3.12", "3.13", "3.14"]
steps:
- name: Skip for docs-only changes
if: needs.changes.outputs.code == 'false'
run: echo "Skipping tests for documentation-only changes"
- name: Checkout code
if: needs.changes.outputs.code == 'true'
uses: actions/checkout@v6
- name: Install uv
if: needs.changes.outputs.code == 'true'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: needs.changes.outputs.code == 'true'
run: uv sync --all-extras
- name: Check code formatting
if: needs.changes.outputs.code == 'true'
run: uv run poe format-check
- name: Run linting and type checking
if: needs.changes.outputs.code == 'true'
run: uv run poe lint
- name: Run tests
if: needs.changes.outputs.code == 'true'
run: uv run poe test-coverage
- name: Upload coverage to Codecov
if: needs.changes.outputs.code == 'true'
uses: codecov/codecov-action@v6
with:
files: coverage.xml
fail_ci_if_error: false
quality:
needs: changes
runs-on: ubuntu-latest
steps:
- name: Skip for docs-only changes
if: needs.changes.outputs.code == 'false'
run: echo "Skipping quality checks for documentation-only changes"
- name: Checkout code
if: needs.changes.outputs.code == 'true'
uses: actions/checkout@v6
- name: Install uv
if: needs.changes.outputs.code == 'true'
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: "3.14"
- name: Install dependencies
if: needs.changes.outputs.code == 'true'
run: uv sync --all-extras
- name: Validate OpenAPI specification
if: needs.changes.outputs.code == 'true'
run: uv run poe validate-openapi
- name: Build documentation
if: needs.changes.outputs.code == 'true'
run: uv run poe docs-build
env:
CI_DOCS_BUILD: "true"
- name: Test documentation
if: needs.changes.outputs.code == 'true'
run: uv run poe test-docs
env:
CI_DOCS_BUILD: "true"