9898 uses : actions-rust-lang/setup-rust-toolchain@v1
9999 with :
100100 toolchain : stable
101- components : rustfmt, clippy
102101 cache : true
103102
104103 # Enhanced caching strategy
@@ -129,35 +128,13 @@ jobs:
129128 run : pnpm install --frozen-lockfile
130129
131130 # Backend tests and checks (if backend changed)
132- - name : Check Rust Formatting
133- if : needs.changes.outputs.backend == 'true'
134- run : |
135- cd src-tauri
136- cargo fmt --all -- --check
137-
138- - name : Run Clippy
139- if : needs.changes.outputs.backend == 'true'
140- run : |
141- cd src-tauri
142- cargo clippy --all-targets --all-features -- -D warnings
143-
144131 - name : Run Rust Unit Tests
145132 if : needs.changes.outputs.backend == 'true'
146133 run : |
147134 cd src-tauri
148135 cargo test --verbose --all-features --lib
149136
150137 # Frontend tests and checks (if frontend changed)
151- - name : Type Check Frontend
152- if : needs.changes.outputs.frontend == 'true'
153- run : pnpm run type-check
154- continue-on-error : false
155-
156- - name : Lint Frontend
157- if : needs.changes.outputs.frontend == 'true'
158- run : pnpm run lint
159- continue-on-error : false
160-
161138 - name : Run Frontend Unit Tests
162139 if : needs.changes.outputs.frontend == 'true'
163140 run : pnpm test
@@ -173,31 +150,7 @@ jobs:
173150 if : needs.changes.outputs.frontend == 'true' && needs.changes.outputs.backend == 'true'
174151 run : |
175152 cd src-tauri
176- cargo build --release
177- # Start backend in background for frontend integration tests
178- cargo run --release &
179- echo $! > backend.pid
180- sleep 5 # Give backend time to start
181- continue-on-error : true
182-
183- # Run frontend integration tests that depend on backend
184- - name : Run Frontend Integration Tests
185- if : needs.changes.outputs.frontend == 'true' && needs.changes.outputs.backend == 'true'
186- run : pnpm run test:integration
187- env :
188- NODE_ENV : test
189- BACKEND_URL : http://localhost:8080
190- continue-on-error : true
191-
192- # Stop backend
193- - name : Stop Backend
194- if : needs.changes.outputs.frontend == 'true' && needs.changes.outputs.backend == 'true'
195- run : |
196- if [ -f backend.pid ]; then
197- kill $(cat backend.pid) || true
198- rm backend.pid
199- fi
200- continue-on-error : true
153+ cargo check --release
201154
202155 # Build Tauri application (includes both frontend and backend)
203156 - name : Build Tauri Application
@@ -209,87 +162,4 @@ jobs:
209162 - name : Run Tauri Integration Tests
210163 run : |
211164 cd src-tauri
212- cargo test --verbose --all-features --test integration
213- continue-on-error : true
214-
215- # Upload build artifacts
216- - name : Upload Tauri Bundles
217- uses : actions/upload-artifact@v4
218- with :
219- name : tauri-bundles-${{ matrix.os }}
220- path : |
221- src-tauri/target/release/bundle/
222- retention-days : 1
223-
224- - name : Upload Frontend Build
225- if : matrix.os == 'macos-latest' # Only upload once
226- uses : actions/upload-artifact@v4
227- with :
228- name : frontend-dist
229- path : dist/
230- retention-days : 1
231-
232- # Quick validation job for PRs (runs on Ubuntu for speed)
233- quick-validation :
234- name : Quick Validation
235- runs-on : ubuntu-latest
236- needs : changes
237- if : github.event_name == 'pull_request' && needs.changes.outputs.skip_ci == 'false'
238-
239- steps :
240- - name : Checkout Repository
241- uses : actions/checkout@v4
242-
243- - name : Setup pnpm
244- uses : pnpm/action-setup@v4
245- with :
246- version : 9
247-
248- - name : Setup Node.js
249- uses : actions/setup-node@v4
250- with :
251- node-version : ' 20'
252- cache : ' pnpm'
253-
254- - name : Install Rust Toolchain
255- uses : actions-rust-lang/setup-rust-toolchain@v1
256- with :
257- toolchain : stable
258- components : rustfmt, clippy
259-
260- - name : Install Dependencies
261- run : pnpm install --frozen-lockfile
262-
263- # Quick checks only
264- - name : Quick Rust Check
265- if : needs.changes.outputs.backend == 'true'
266- run : |
267- cd src-tauri
268- cargo check --all-targets
269- cargo fmt --all -- --check
270-
271- - name : Quick Frontend Check
272- if : needs.changes.outputs.frontend == 'true'
273- run : |
274- pnpm run type-check
275- pnpm run build
276-
277- # Final status check
278- ci-success :
279- name : CI Success
280- runs-on : ubuntu-latest
281- needs : [ full-stack-test-build, quick-validation ]
282- if : always() && needs.changes.outputs.skip_ci == 'false'
283-
284- steps :
285- - name : Check CI Status
286- run : |
287- if [[ "${{ needs.full-stack-test-build.result }}" == "failure" ]]; then
288- echo "Full stack build failed"
289- exit 1
290- elif [[ "${{ needs.quick-validation.result }}" == "failure" ]]; then
291- echo "Quick validation failed"
292- exit 1
293- else
294- echo "CI OK"
295- fi
165+ cargo test --verbose --all-features
0 commit comments