-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (97 loc) · 2.73 KB
/
ci.yaml
File metadata and controls
120 lines (97 loc) · 2.73 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
name: CI
on:
push:
branches: [main, 'release-please--**']
pull_request:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Ruff check
run: uvx ruff check . --output-format=github
- name: Ruff format
run: uvx ruff format --check --diff .
typecheck:
name: Type check
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --group dev
- name: Run mypy
run: uv run mypy src/
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --group dev
- name: Run tests
run: uv run pytest -v --cov=fluxopt_plot --cov-report=xml --cov-report=term-missing
- name: Upload coverage
if: matrix.python-version == '3.12' && !cancelled()
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false
docs:
name: Docs build
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --extra docs
- name: Build docs
run: uv run mkdocs build --strict
ci-success:
name: CI Success
needs: [lint, typecheck, test, docs]
if: always()
runs-on: ubuntu-24.04
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.lint.result }}" != "success" || \
"${{ needs.typecheck.result }}" != "success" || \
"${{ needs.test.result }}" != "success" || \
"${{ needs.docs.result }}" != "success" ]]; then
echo "::error::One or more CI jobs failed"
exit 1
fi