-
Notifications
You must be signed in to change notification settings - Fork 8
118 lines (107 loc) · 4.19 KB
/
test-on-pr.yml
File metadata and controls
118 lines (107 loc) · 4.19 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
name: 'Test on pull request'
on: [pull_request]
jobs:
test-tauri:
strategy:
fail-fast: false
matrix:
platform: [macos-15, ubuntu-22.04, windows-latest]
runs-on: ${{ matrix.platform }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 24
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.85.1
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install xvfb
- name: install frontend dependencies
run: |
npm install
echo "npm run build not executed as we will be running tests against the checked in release artifacts only!"
npm run _copy-dist-to-test
npm run tauri build
- name: Run tauri integration tests in ubuntu
if: matrix.platform == 'ubuntu-22.04'
run: xvfb-run ./src-tauri/target/release/phoenix-file-system -q
- name: Run tauri integration tests in macos
if: matrix.platform == 'macos-15'
run: ./src-tauri/target/release/Phoenix\ File\ system -q
- name: Run tauri integration tests in windows
# GUI apps in windows doesn't log on console. so we capture the output to a text file and print it, then fail on error.
if: matrix.platform == 'windows-latest'
id: windowsRun
run: |
"src-tauri\target\release\Phoenix File system.exe" -q > output.txt 2>&1
shell: cmd
continue-on-error: true
- name: Print windows integration test output to console
if: matrix.platform == 'windows-latest'
run: |
type output.txt
shell: cmd
- name: Fail on test runs failed in windows
if: matrix.platform == 'windows-latest' && steps.windowsRun.outcome == 'failure'
run: |
echo "Windows tests failed, marking step as failed"
exit 1
shell: cmd
# Electron tests are only tested for Linux for now
test-electron:
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 24
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y xvfb
- name: install frontend dependencies
run: |
npm install
echo "npm run build not executed as we will be running tests against the checked in release artifacts only!"
npm run _copy-dist-to-test
- name: Run electron integration tests
run: |
npm run _serve-tauri &
sleep 2
xvfb-run ./src-electron/node_modules/.bin/electron src-electron/main.js --quit-when-done
# - name: Run electron integration tests in macos
# if: matrix.platform == 'macos-15'
# run: |
# npm run _serve-tauri &
# sleep 2
# ./src-electron/node_modules/.bin/electron src-electron/main.js --quit-when-done
# - name: Run electron integration tests in windows
# if: matrix.platform == 'windows-latest'
# id: windowsElectronRun
# run: |
# Start-Process -NoNewWindow -FilePath "npm" -ArgumentList "run", "_serve-tauri"
# Start-Sleep -Seconds 2
# & ".\src-electron\node_modules\.bin\electron.cmd" "src-electron\main.js" "--quit-when-done" 2>&1 | Tee-Object -FilePath electron-output.txt
# shell: pwsh
# continue-on-error: true
# - name: Print windows electron test output to console
# if: matrix.platform == 'windows-latest'
# run: |
# type electron-output.txt
# shell: cmd
# - name: Fail on electron test runs failed in windows
# if: matrix.platform == 'windows-latest' && steps.windowsElectronRun.outcome == 'failure'
# run: |
# echo "Windows Electron tests failed, marking step as failed"
# exit 1
# shell: cmd