-
Notifications
You must be signed in to change notification settings - Fork 3
231 lines (201 loc) · 7.97 KB
/
Copy pathpr.yml
File metadata and controls
231 lines (201 loc) · 7.97 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
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: "24"
PNPM_VERSION: "10"
jobs:
# ─────────────────────────────────────────────────────────────────────────────
# E2E Tests — Playwright against server mode
# Disabled: Wails v3 alpha.74 server mode is broken (BrowserWindow missing
# AttachModal method). Re-enable when upstream fixes this.
# ─────────────────────────────────────────────────────────────────────────────
e2e-tests:
if: false # TODO: re-enable when Wails v3 server mode is fixed
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev build-essential pkg-config xvfb
version: 1.0
- 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 Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Wails v3
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
- name: Build workspace packages
run: task packages
- name: Install Playwright browsers
working-directory: e2e
run: pnpm exec playwright install --with-deps chromium
- name: Build and start server mode
run: |
task common:build:frontend
go build -tags server -o bin/Omniview-server .
bin/Omniview-server &
echo "Waiting for server to be ready..."
for i in $(seq 1 60); do
if curl -sf http://localhost:34115/health > /dev/null 2>&1; then
echo "Server ready"
break
fi
sleep 2
done
- 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
build-tags: "production"
extra-ldflags: ""
- os: ubuntu-latest
platform: linux/amd64
artifact-name: pr-build-linux
build-tags: "production,webkit2_41"
extra-ldflags: ""
- os: windows-latest
platform: windows/amd64
artifact-name: pr-build-windows
build-tags: "production"
extra-ldflags: "-H windowsgui"
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Linux dependencies
if: runner.os == 'Linux'
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev build-essential pkg-config
version: 1.0
- 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 Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Wails v3
shell: bash
run: go install github.com/wailsapp/wails/v3/cmd/wails3@latest
- name: Build workspace packages
shell: bash
run: task packages
- name: Build frontend
shell: bash
run: task common:build:frontend
- name: Build Omniview
shell: bash
env:
CGO_ENABLED: "1"
CGO_CFLAGS: ${{ runner.os == 'macOS' && '-mmacosx-version-min=10.15' || '' }}
CGO_LDFLAGS: ${{ runner.os == 'macOS' && '-mmacosx-version-min=10.15' || '' }}
MACOSX_DEPLOYMENT_TARGET: ${{ runner.os == 'macOS' && '10.15' || '' }}
run: |
go build -tags "${{ matrix.build-tags }}" -trimpath -buildvcs=false \
-ldflags "-w -s ${{ matrix.extra-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 \
-X github.com/omniviewdev/omniview/internal/appstate.buildStateDir=~/.omniview-pr" \
-o bin/Omniview .
- name: Create macOS .app bundle
if: runner.os == 'macOS'
run: |
task common:generate:icons
mkdir -p bin/Omniview.app/Contents/MacOS
mkdir -p bin/Omniview.app/Contents/Resources
cp build/darwin/icons.icns bin/Omniview.app/Contents/Resources/
cp bin/Omniview bin/Omniview.app/Contents/MacOS/
cp build/darwin/Info.plist bin/Omniview.app/Contents/
codesign --force --deep --sign - bin/Omniview.app
- name: Prepare artifact (macOS)
if: runner.os == 'macOS'
run: |
cd bin
zip -r Omniview-pr${{ github.event.pull_request.number }}-macos.zip Omniview.app
- name: Prepare artifact (Linux)
if: runner.os == 'Linux'
working-directory: bin
run: mv Omniview "Omniview-pr${{ github.event.pull_request.number }}-linux-amd64"
- name: Prepare artifact (Windows)
if: runner.os == 'Windows'
working-directory: bin
run: Rename-Item -Path "Omniview" -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: |
bin/*.zip
bin/Omniview-pr*
if-no-files-found: error
retention-days: 5