Skip to content

Commit c527ad0

Browse files
committed
ci: electron test runners in gihub actions linux
1 parent 094622d commit c527ad0

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/desktop-linux-test-pull.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jobs:
2525
- name: install dependencies (ubuntu only)
2626
run: |
2727
sudo apt-get update
28-
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
29-
sudo apt install build-essential curl wget file libssl-dev libayatana-appindicator3-dev
28+
sudo apt install build-essential curl wget file libssl-dev
3029
sudo apt-get install xvfb
3130
3231
- name: npm install ci deps
@@ -63,7 +62,7 @@ jobs:
6362
with:
6463
timeout_minutes: 12
6564
max_attempts: 3
66-
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=unit -q
65+
command: xvfb-run src-electron/dist/phoenix-test-runner.appimage --run-tests=unit -q
6766

6867
- name: Run tauri integration tests
6968
uses: nick-fields/retry@v3
@@ -72,7 +71,7 @@ jobs:
7271
with:
7372
timeout_minutes: 12
7473
max_attempts: 3
75-
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=integration -q
74+
command: xvfb-run src-electron/dist/phoenix-test-runner.appimage --run-tests=integration -q
7675

7776
- name: Run tauri mainview tests
7877
uses: nick-fields/retry@v3
@@ -81,7 +80,7 @@ jobs:
8180
with:
8281
timeout_minutes: 12
8382
max_attempts: 3
84-
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=mainview -q
83+
command: xvfb-run src-electron/dist/phoenix-test-runner.appimage --run-tests=mainview -q
8584

8685
- name: Run tauri livepreview tests
8786
uses: nick-fields/retry@v3
@@ -90,7 +89,7 @@ jobs:
9089
with:
9190
timeout_minutes: 12
9291
max_attempts: 3
93-
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=livepreview -q
92+
command: xvfb-run src-electron/dist/phoenix-test-runner.appimage --run-tests=livepreview -q
9493

9594
- name: Run tauri LegacyInteg tests
9695
uses: nick-fields/retry@v3
@@ -99,7 +98,7 @@ jobs:
9998
with:
10099
timeout_minutes: 20
101100
max_attempts: 3
102-
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=LegacyInteg -q
101+
command: xvfb-run src-electron/dist/phoenix-test-runner.appimage --run-tests=LegacyInteg -q
103102

104103
- name: Fail on test runs failed in Linux
105104
if: steps.linuxRunUnit.outcome == 'failure' || steps.linuxRunIntegration.outcome == 'failure' || steps.linuxRunMainview.outcome == 'failure' || steps.linuxRunLivepreview.outcome == 'failure' || steps.linuxRunLegacyInteg.outcome == 'failure'

src-build/createDistTestRelease.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function buildElectron() {
171171

172172
// Build AppImage
173173
console.log('Building AppImage...');
174-
run('npm run build:appimage', { cwd: join(projectRoot, 'src-electron') });
174+
run('npm run build:appimageForTest', { cwd: join(projectRoot, 'src-electron') });
175175
}
176176

177177
async function main() {

src-electron/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"description": "Phoenix Code Experimental Build",
99
"main": "main.js",
1010
"scripts": {
11-
"build:appimage": "electron-builder --linux AppImage && node renameBin.js"
11+
"clean:appimage": "shx rm -rf dist/*.AppImage",
12+
"build:appimage": "npm run clean:appimage && electron-builder --linux AppImage && node renameBin.js",
13+
"build:appimageForTest": "npm run clean:appimage && electron-builder --linux AppImage && shx mv dist/*.AppImage dist/phoenix-test-runner.appimage"
1214
},
1315
"dependencies": {
1416
"keytar": "^7.9.0"

0 commit comments

Comments
 (0)