-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (181 loc) · 5.32 KB
/
Copy pathci.yml
File metadata and controls
193 lines (181 loc) · 5.32 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
changes:
name: detect changes
runs-on: ubuntu-latest
outputs:
rust: ${{ steps.filter.outputs.rust == 'true' || steps.filter.outputs.ci == 'true' || github.ref == 'refs/heads/main' }}
python: ${{ steps.filter.outputs.python == 'true' || steps.filter.outputs.ci == 'true' || github.ref == 'refs/heads/main' }}
ui: ${{ steps.filter.outputs.ui == 'true' || steps.filter.outputs.ci == 'true' || github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
rust:
- 'crates/**'
- 'apps/server/**'
- 'apps/inference/**'
- 'apps/cli/**'
- 'apps/sdk/**'
- 'Cargo.toml'
- 'Cargo.lock'
python:
- 'apps/sdk/**'
- 'crates/transforms/**'
ui:
- 'apps/ui/**'
ci:
- '.github/workflows/**'
- '.github/actions/**'
fmt:
name: cargo fmt
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: main workspace
run: cargo fmt --check
- name: transforms workspace
working-directory: crates/transforms
run: cargo fmt --check
clippy:
name: cargo clippy
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: wasm32-wasip2
- uses: Swatinem/rust-cache@v2
with:
shared-key: rust-stable-workspace
- name: main workspace
run: cargo clippy --workspace --all-targets -- -D warnings
- name: transforms workspace (wasm)
working-directory: crates/transforms
run: cargo clippy --target wasm32-wasip2 -- -D warnings
test-rust:
name: cargo test
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip2
- uses: Swatinem/rust-cache@v2
with:
shared-key: rust-stable-workspace
- uses: ./.github/actions/build-wasm-transform
- run: cargo test --workspace --no-fail-fast
msrv:
name: MSRV (1.88) - cli
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88
- uses: Swatinem/rust-cache@v2
- run: cargo check -p edgeflow-cli --locked
deny:
name: cargo deny
needs: changes
if: needs.changes.outputs.rust == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check
arguments: --all-features
test-python:
name: python sdk tests (py${{ matrix.python }})
needs: changes
if: needs.changes.outputs.python == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip2
- uses: Swatinem/rust-cache@v2
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- uses: ./.github/actions/build-wasm-transform
- name: maturin develop
working-directory: apps/sdk
run: |
uv venv -p ${{ matrix.python }}
uv run --with maturin maturin develop --features python
- name: pytest
working-directory: apps/sdk
run: uv run pytest
ui:
name: ui (check / test / build)
needs: changes
if: needs.changes.outputs.ui == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: apps/ui/package-lock.json
- name: install
working-directory: apps/ui
run: npm ci
- name: svelte-check
working-directory: apps/ui
run: npm run check
- name: vitest
working-directory: apps/ui
run: npm test
- name: build
working-directory: apps/ui
run: npm run build
commitlint:
name: commitlint
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: install commitlint
run: npm install --no-save @commitlint/cli @commitlint/config-conventional
- name: lint PR commits
run: |
npx commitlint \
--from ${{ github.event.pull_request.base.sha }} \
--to ${{ github.event.pull_request.head.sha }} \
--verbose