Skip to content

Commit 37da3af

Browse files
committed
upgrade CI GHA
1 parent db070f5 commit 37da3af

2 files changed

Lines changed: 117 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 109 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Rust CI
1+
name: Full Stack CI
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: [ "1.0.4" ]
66
pull_request:
77
branches: [ "main" ]
88
workflow_dispatch:
@@ -11,7 +11,9 @@ env:
1111
CARGO_TERM_COLOR: always
1212

1313
jobs:
14-
build:
14+
# Backend Rust tests
15+
rust-tests:
16+
name: Rust Backend Tests
1517
runs-on: macos-latest
1618

1719
steps:
@@ -24,7 +26,109 @@ jobs:
2426
toolchain: stable
2527
target: x86_64-unknown-linux-gnu
2628

27-
- name: Run tests
29+
- name: Cache Cargo dependencies
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.cargo/bin/
34+
~/.cargo/registry/index/
35+
~/.cargo/registry/cache/
36+
~/.cargo/git/db/
37+
src-tauri/target/
38+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-cargo-
41+
42+
- name: Run Rust tests
43+
run: |
44+
cd src-tauri
45+
cargo test --verbose
46+
47+
- name: Check Rust formatting
48+
run: |
49+
cd src-tauri
50+
cargo fmt --all -- --check
51+
52+
# Frontend tests
53+
frontend-tests:
54+
name: Frontend Tests
55+
runs-on: macos-latest
56+
57+
steps:
58+
- name: Fetch Repository
59+
uses: actions/checkout@v4
60+
61+
- name: Setup Node.js
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version: '20'
65+
cache: 'pnpm'
66+
67+
- name: Setup pnpm
68+
uses: pnpm/action-setup@v4
69+
with:
70+
version: latest
71+
72+
- name: Cache pnpm dependencies
73+
uses: actions/cache@v4
74+
with:
75+
path: |
76+
~/.pnpm-store
77+
node_modules
78+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
79+
restore-keys: |
80+
${{ runner.os }}-pnpm-
81+
82+
- name: Install dependencies
83+
run: pnpm install --frozen-lockfile
84+
85+
- name: Run frontend tests
86+
run: pnpm test
87+
env:
88+
NODE_ENV: test
89+
90+
# Security and quality checks
91+
security-checks:
92+
name: Security & Quality Checks
93+
runs-on: ubuntu-latest
94+
95+
steps:
96+
- name: Fetch Repository
97+
uses: actions/checkout@v4
98+
99+
- name: Setup Node.js
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version: '20'
103+
cache: 'pnpm'
104+
105+
- name: Setup pnpm
106+
uses: pnpm/action-setup@v4
107+
with:
108+
version: latest
109+
110+
- name: Install Rust toolchain
111+
uses: actions-rust-lang/setup-rust-toolchain@v1
112+
with:
113+
toolchain: stable
114+
115+
- name: Install dependencies
116+
run: pnpm install --frozen-lockfile
117+
118+
- name: Run frontend security audit
119+
run: pnpm audit
120+
continue-on-error: true
121+
122+
- name: Run Rust security audit
123+
run: |
124+
cargo install cargo-audit
125+
cd src-tauri
126+
cargo audit
127+
continue-on-error: true
128+
129+
- name: Check for outdated dependencies
28130
run: |
131+
pnpm outdated
29132
cd src-tauri
30-
cargo test --verbose
133+
cargo outdated
134+
continue-on-error: true

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,18 @@ To quickly test FileFlow:
8484

8585
To run unit tests, use the following command:
8686

87+
#### For the Rust backend:
88+
8789
```bash
8890
cargo test
8991
```
9092

93+
#### For the Tauri frontend:
94+
95+
```bash
96+
pnpm test
97+
```
98+
9199
### Benchmarks available
92100

93101
To run benchmarks, use the following command:

0 commit comments

Comments
 (0)