-
Notifications
You must be signed in to change notification settings - Fork 3
191 lines (165 loc) · 6.33 KB
/
Copy pathpr.yml
File metadata and controls
191 lines (165 loc) · 6.33 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: PR Validation
on:
pull_request:
branches: [main]
concurrency:
group: pr-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
NODE_OPTIONS: "--max-old-space-size=4096"
GO_VERSION: "1.26"
NODE_VERSION: "20"
PNPM_VERSION: "10"
jobs:
# ─────────────────────────────────────────────────────────────────────────────
# E2E Tests — Playwright against wails dev
# ─────────────────────────────────────────────────────────────────────────────
e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev xvfb
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: |
- args: []
- args: [--global, typescript]
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: "go.sum"
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.11.0
- name: Build workspace packages
run: make packages
- name: Install Playwright browsers
working-directory: e2e
run: pnpm exec playwright install --with-deps chromium
- name: Start wails dev
run: |
xvfb-run wails dev -loglevel Error -tags webkit2_41 -nosyncgomod -m -noreload -skipbindings &
echo "Waiting for Wails dev server..."
for i in $(seq 1 150); do
if curl -sf http://localhost:34115 > /dev/null 2>&1; then
echo "Wails dev server is ready (${i}s)"
exit 0
fi
sleep 2
done
echo "Timed out waiting for Wails dev server"
exit 1
- name: Run Playwright tests
working-directory: e2e
run: pnpm test
- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
e2e/playwright-report/
e2e/test-results/
retention-days: 7
# ─────────────────────────────────────────────────────────────────────────────
# Build Artifacts — downloadable binaries for manual testing
# ─────────────────────────────────────────────────────────────────────────────
build-artifacts:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
platform: darwin/universal
artifact-name: pr-build-macos
extra-flags: ""
- os: ubuntu-latest
platform: linux/amd64
artifact-name: pr-build-linux
extra-flags: "-tags webkit2_41"
- os: windows-latest
platform: windows/amd64
artifact-name: pr-build-windows
extra-flags: ""
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: |
- args: []
- args: [--global, typescript]
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: "go.sum"
- name: Install Wails
shell: bash
run: go install github.com/wailsapp/wails/v2/cmd/wails@v2.11.0
- name: Build workspace packages
shell: bash
run: make packages
- name: Build Omniview
shell: bash
run: |
wails build -platform ${{ matrix.platform }} \
${{ matrix.extra-flags }} \
-webview2 download \
-ldflags "\
-X github.com/omniviewdev/omniview/internal/version.Version=0.0.0-pr.${{ github.event.pull_request.number }} \
-X github.com/omniviewdev/omniview/internal/version.GitCommit=${{ github.sha }} \
-X github.com/omniviewdev/omniview/internal/version.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
-X github.com/omniviewdev/omniview/internal/version.Development=true"
- name: Prepare artifact (macOS)
if: runner.os == 'macOS'
run: |
cd build/bin
zip -r Omniview-pr${{ github.event.pull_request.number }}-macos.zip Omniview.app
- name: Prepare artifact (Linux)
if: runner.os == 'Linux'
working-directory: build/bin
run: mv Omniview "Omniview-pr${{ github.event.pull_request.number }}-linux-amd64"
- name: Prepare artifact (Windows)
if: runner.os == 'Windows'
working-directory: build/bin
run: Rename-Item -Path "Omniview.exe" -NewName "Omniview-pr${{ github.event.pull_request.number }}-windows-amd64.exe"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: |
build/bin/*.zip
build/bin/Omniview-pr*
if-no-files-found: error
retention-days: 5