Skip to content

Commit a1b6909

Browse files
fix: build frontend in test job and improve caching
- Add frontend build to test job so Tauri compilation works - Improve Node.js caching to include ~/.cache/npm - Ensure dist directory exists before Tauri compilation - Add proper error handling for missing dist directory
1 parent d89e92f commit a1b6909

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
with:
4444
path: |
4545
~/.npm
46+
~/.cache/npm
4647
web/node_modules
4748
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
4849
restore-keys: |
@@ -62,6 +63,18 @@ jobs:
6263
working-directory: web
6364
continue-on-error: true
6465

66+
- name: Clean previous build
67+
run: rm -rf ../dist
68+
working-directory: web
69+
70+
- name: Build frontend for Tauri compilation
71+
run: |
72+
echo "Building frontend for Tauri compilation..."
73+
npm run build
74+
echo "Frontend build completed"
75+
ls -la ../dist || (echo "dist directory not found in workspace root" && exit 1)
76+
working-directory: web
77+
6578
- name: Format check
6679
run: cargo fmt --all -- --check
6780

@@ -119,6 +132,7 @@ jobs:
119132
with:
120133
path: |
121134
~/.npm
135+
~/.cache/npm
122136
web/node_modules
123137
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
124138
restore-keys: |
@@ -129,14 +143,15 @@ jobs:
129143
working-directory: web
130144

131145
- name: Clean previous build
132-
run: rm -rf dist
146+
run: rm -rf ../dist
147+
working-directory: web
133148

134149
- name: Build frontend
135150
run: |
136151
echo "Building frontend..."
137152
npm run build
138153
echo "Frontend build completed"
139-
ls -la dist || (echo "dist directory not found in workspace root" && exit 1)
154+
ls -la ../dist || (echo "dist directory not found in workspace root" && exit 1)
140155
working-directory: web
141156

142157
- name: Verify frontend dist exists

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
with:
5656
path: |
5757
~/.npm
58+
~/.cache/npm
5859
web/node_modules
5960
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
6061
restore-keys: |
@@ -65,14 +66,15 @@ jobs:
6566
working-directory: web
6667

6768
- name: Clean previous build
68-
run: rm -rf dist
69+
run: rm -rf ../dist
70+
working-directory: web
6971

7072
- name: Build frontend
7173
run: |
7274
echo "Building frontend..."
7375
npm run build
7476
echo "Frontend build completed"
75-
ls -la dist || (echo "dist directory not found in workspace root" && exit 1)
77+
ls -la ../dist || (echo "dist directory not found in workspace root" && exit 1)
7678
working-directory: web
7779

7880
- name: Verify frontend dist exists

0 commit comments

Comments
 (0)