-
-
Notifications
You must be signed in to change notification settings - Fork 9
177 lines (154 loc) · 5.66 KB
/
Copy pathe2e-desktop.yml
File metadata and controls
177 lines (154 loc) · 5.66 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Reusable workflow: Desktop E2E tests (Linux + Windows)
# Call with workflow_call from ci.yml or e2e-desktop-comment.yml
name: E2E Desktop
on:
workflow_call:
inputs:
ref:
description: Git ref to checkout (e.g. PR head SHA or github.sha)
required: true
type: string
secrets:
TAURI_SIGNING_PRIVATE_KEY:
required: false
TAURI_SIGNING_PRIVATE_KEY_PASSWORD:
required: false
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
jobs:
e2e-desktop:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Install Linux deps
if: matrix.os == 'ubuntu-latest'
uses: ./.github/actions/install-linux-deps
with:
e2e: 'true'
- uses: dtolnay/rust-toolchain@stable
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-e2e-desktop
shared-key: rust-${{ matrix.os == 'ubuntu-latest' && 'x86_64-unknown-linux-gnu' || 'x86_64-pc-windows-msvc' }}
cache-on-failure: true
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
# Cache pnpm store for faster installs
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- name: Cache tauri-driver
uses: actions/cache@v4
id: tauri-driver-cache
with:
path: ~/.cargo/bin/tauri-driver*
key: tauri-driver-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install tauri-driver
if: steps.tauri-driver-cache.outputs.cache-hit != 'true'
run: cargo install tauri-driver --locked
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
# Cache Tauri CLI binary (avoid recompiling on every run)
- name: Cache Tauri CLI
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/cargo-tauri*
~/.cargo/bin/tauri*
key: tauri-cli-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
tauri-cli-${{ runner.os }}-
- run: pnpm install --frozen-lockfile
- name: Build app (Linux)
if: matrix.os == 'ubuntu-latest'
run: pnpm --filter @mcpmux/desktop exec tauri build --bundles deb,rpm,updater
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Build app (Windows)
if: matrix.os == 'windows-latest'
run: pnpm build
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Run desktop E2E tests (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
# Start dbus session and unlock gnome-keyring with a dummy password for CI
dbus-run-session -- bash -c '
echo "test" | gnome-keyring-daemon --unlock --components=secrets
export $(gnome-keyring-daemon --start --components=secrets)
sleep 1
xvfb-run --auto-servernum pnpm test:e2e
'
- name: Run desktop E2E tests (Windows)
if: matrix.os == 'windows-latest'
run: pnpm test:e2e
# Upload test results and artifacts
- name: Upload E2E test results
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-desktop-results-${{ matrix.os }}
path: |
tests/e2e/reports/
tests/e2e/screenshots/
tests/e2e/videos/
retention-days: 7
# Publish E2E Desktop test results with separate checks per OS
e2e-report:
needs: [e2e-desktop]
if: always()
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Download all E2E test results
uses: actions/download-artifact@v4
with:
pattern: e2e-desktop-results-*
path: test-results
- name: 'Report: E2E Desktop Tests (Linux)'
uses: dorny/test-reporter@v2
if: always()
with:
name: '🖥️ E2E Desktop Tests (Linux)'
path: test-results/e2e-desktop-results-ubuntu-latest/**/*.xml
reporter: java-junit
fail-on-error: false
- name: 'Report: E2E Desktop Tests (Windows)'
uses: dorny/test-reporter@v2
if: always()
with:
name: '🖥️ E2E Desktop Tests (Windows)'
path: test-results/e2e-desktop-results-windows-latest/**/*.xml
reporter: java-junit
fail-on-error: false