-
Notifications
You must be signed in to change notification settings - Fork 0
179 lines (144 loc) · 4.66 KB
/
ci.yml
File metadata and controls
179 lines (144 loc) · 4.66 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Rust cache
uses: Swatinem/rust-cache@v2.9.1
- name: Cargo fmt
run: cargo fmt --all --check
- name: Cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.12"
cache-dependency-glob: pyproject.toml
- name: Install Python dev deps
run: uv sync --extra dev
- name: Ruff check
run: uv run ruff check py_src/ tests/
- name: Ruff format check
run: uv run ruff format --check py_src/ tests/
- name: Mypy
run: uv run mypy py_src/taskito/ tests/python/ --no-incremental
dashboard-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: "22"
cache: "npm"
cache-dependency-path: dashboard/package-lock.json
- name: Install dependencies
run: cd dashboard && npm ci
- name: Biome lint + format check
run: cd dashboard && npx biome ci src/
- name: TypeScript check
run: cd dashboard && npx tsc --noEmit
- name: Build check
run: cd dashboard && npx vite build
rust-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2.9.1
with:
save-if: false
- name: Run Rust tests
run: cargo test --workspace
env:
LD_LIBRARY_PATH: ${{ env.pythonLocation }}/lib
- name: Check Rust (postgres features)
run: cargo check --workspace --features postgres
- name: Check Rust (redis features)
run: cargo check --workspace --features redis
- name: Check Rust (native-async features)
run: cargo check --workspace --features native-async
test:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
include:
- os: macos-latest
python-version: "3.13"
- os: macos-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.13"
- os: windows-latest
python-version: "3.10"
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2.9.1
with:
save-if: ${{ matrix.os != 'ubuntu-latest' }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.12"
cache-dependency-glob: pyproject.toml
- name: Install dependencies
run: uv sync --extra dev
- name: Build native extension
uses: PyO3/maturin-action@v1
with:
command: develop
args: --release --features extension-module,postgres,redis,native-async,workflows
- name: Run Python tests
run: |
set +e
uv run python -m pytest tests/python/ -v --junitxml=test-results.xml
PYTEST_EXIT=$?
if [ $PYTEST_EXIT -eq 0 ]; then exit 0; fi
# SIGABRT (134) during interpreter shutdown is a known PyO3 issue;
# check junit XML to confirm all tests actually passed.
if [ $PYTEST_EXIT -eq 134 ] && [ -f test-results.xml ]; then
FAILURES=$(python -c "
import xml.etree.ElementTree as ET
r = ET.parse('test-results.xml').getroot()
print(int(r.get('failures',0)) + int(r.get('errors',0)))
")
if [ "$FAILURES" = "0" ]; then
echo "::warning::Tests passed but process crashed during cleanup (known PyO3 issue)"
exit 0
fi
fi
exit $PYTEST_EXIT
shell: bash