Repository navigation
708 lines (697 loc) · 37.9 KB
/
Copy pathmygo.yml
File metadata and controls
708 lines (697 loc) · 37.9 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# Copyright 2026 Han Li and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The application: formatting, golangci-lint and the unit tests (with
# coverage gates), the end-to-end scenarios that drive the built application
# (against captured output and against the real vfox, and its icon in the tray
# against a stand-in for the host of the tray icons on Linux, against the GNOME
# Shell of Ubuntu in a container, and against the taskbar on Windows), the Docker
# image of the gateway (built, and run against the application as the people who use
# it run it: it is not published), the Linux packages and the Windows MSIX bundle, and
# the census of the screens of the desktop in the text engine of each platform (Linux, Windows
# on x64 and on ARM, macOS).
# shared/tooling/internal/runtask runs the same steps locally; keep them in sync.
# The tool versions are in mygo/versions.env.
name: mygo
on:
push:
branches: [main]
paths:
- mygo/**
- shared/**
- .github/workflows/mygo.yml
pull_request:
paths:
- mygo/**
- shared/**
- .github/workflows/mygo.yml
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Packages needed to build and run mygo applications on Linux: nothing to
# build with (mygo needs no C compiler, and only the race detector of the tests
# needs one), and GTK 3 to run, which mygo loads when it starts. The icon in the
# tray needs no library: the application speaks to the panel of the desktop over
# the session bus.
# Fontconfig and the fonts are what the interface looks up.
LINUX_PACKAGES: >-
build-essential libgtk-3-0t64 fontconfig fonts-ubuntu fonts-noto-cjk
xvfb xauth dbus-x11 lintian desktop-file-utils
jobs:
unit:
name: Check and test with the race detector
# The checks of the code and its unit tests, with the race detector, which the job that builds the application does not wait
# for: the two take about as long as each other. Forks do not run CI.
if: github.repository == 'version-fox/vfox-plus'
runs-on: ubuntu-26.04
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Read the pinned versions
run: grep -hE '^[A-Z0-9_]+=' mygo/versions.env >> "$GITHUB_ENV"
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: mygo/go.sum
- name: Install the Linux packages
uses: ./.github/actions/install-linux-packages
with:
packages: ${{ env.LINUX_PACKAGES }}
- name: Install golangci-lint
env:
# Raises the API rate limit of the fallback in the script.
GH_TOKEN: ${{ github.token }}
run: |
archive="golangci-lint-$GOLANGCI_LINT_VERSION-linux-amd64"
shared/scripts/download-release-asset.sh \
golangci/golangci-lint "v$GOLANGCI_LINT_VERSION" "$archive.tar.gz" \
"$RUNNER_TEMP/$archive.tar.gz" "$GOLANGCI_LINT_SHA256"
tar -xzf "$RUNNER_TEMP/$archive.tar.gz" -C "$RUNNER_TEMP"
echo "$RUNNER_TEMP/$archive" >> "$GITHUB_PATH"
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Where vfxtool prepare keeps the npm package that the icons come from.
path: ~/.cache/vfox-plus/icons
key: icons-${{ hashFiles('shared/icons.json') }}
- name: Build vfxtool
run: go -C shared/tooling build -o "$RUNNER_TEMP/vfxtool" ./cmd/vfxtool
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 26
cache: npm
cache-dependency-path: mygo/web/package-lock.json
- name: Build and test the web interface
# TypeScript and Vite, bundled into the single page that the gateway
# embeds as mygo/gateway/webapp.html (no other requests, desktop and web
# stay on one design). The built page is committed: the check below
# fails when the sources and the checked-in page disagree.
working-directory: mygo/web
run: |
npm ci
npm test
npm run build
- name: The built page is committed
run: git diff --exit-code -- mygo/gateway/webapp.html
- name: Prepare the embedded assets
# The icons, the translations and the licenses of the Go modules.
run: '"$RUNNER_TEMP/vfxtool" prepare --root mygo'
- name: Verify the modules
working-directory: mygo
run: go mod verify
- name: Check formatting
working-directory: mygo
run: golangci-lint fmt --diff
- name: Lint
working-directory: mygo
run: |
golangci-lint run
golangci-lint run --build-tags e2e
- name: Test
working-directory: mygo
run: |
go vet ./...
# The race detector needs cgo; the application is built without it. The census of the screens is taken by the
# job that builds the application, without it: the census does not need the race detector, which makes it three
# times slower. The race run has half an hour: on the runners, the tests of the package of the screens ran past
# the default of ten minutes with the race detector (the run at ff4d63d stopped them there), where a machine of
# ours takes seven.
CGO_ENABLED=1 go test -race -timeout 30m -coverprofile=coverage.out ./...
"$RUNNER_TEMP/vfxtool" coverage coverage.out 85
- name: Test vfxtool
run: |
go -C shared/tooling vet ./...
go -C shared/tooling test ./...
build:
name: Take the census, test end to end and package
# Forks do not run CI.
if: github.repository == 'version-fox/vfox-plus'
runs-on: ubuntu-26.04
timeout-minutes: 60
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Read the pinned versions
run: grep -hE '^[A-Z0-9_]+=' mygo/versions.env >> "$GITHUB_ENV"
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: mygo/go.sum
- name: Install the Linux packages
uses: ./.github/actions/install-linux-packages
with:
packages: ${{ env.LINUX_PACKAGES }}
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Where vfxtool prepare keeps the npm package that the icons come from.
path: ~/.cache/vfox-plus/icons
key: icons-${{ hashFiles('shared/icons.json') }}
- name: Build vfxtool
run: go -C shared/tooling build -o "$RUNNER_TEMP/vfxtool" ./cmd/vfxtool
- name: Prepare the embedded assets
# The icons, the translations and the licenses of the Go modules.
run: '"$RUNNER_TEMP/vfxtool" prepare --root mygo'
- name: Build the release
run: '"$RUNNER_TEMP/vfxtool" build --root mygo mygo/build/vfox-plus'
- name: Take the census of the screens
# The census of the screens, which the job that checks and tests the code leaves out: it does not need the race
# detector, which makes it three times slower. It takes the screens in the fonts that the runner has with the
# packages above; the census of the matrix takes the screens of Linux again, with the fonts that the desktops of
# Linux set their text in installed.
working-directory: mygo
run: go test ./ui -run TestTheScreensAreWithinTheBudgets -count=1
- name: Install vfox
env:
GH_TOKEN: ${{ github.token }}
run: |
archive="vfox_${VFOX_VERSION}_linux_x86_64"
shared/scripts/download-release-asset.sh \
version-fox/vfox "v$VFOX_VERSION" "$archive.tar.gz" \
"$RUNNER_TEMP/$archive.tar.gz" "$VFOX_SHA256"
tar -xzf "$RUNNER_TEMP/$archive.tar.gz" -C "$RUNNER_TEMP"
echo "VFOX_PLUS_E2E_VFOX=$RUNNER_TEMP/$archive/vfox" >> "$GITHUB_ENV"
- name: Run the end-to-end scenarios in a virtual display
env:
# `vfxtool measure` writes its numbers here for memory.yml.
VFOX_PLUS_MEASURE_OUTPUT: ${{ runner.temp }}/memory/memory.txt
run: |
"$RUNNER_TEMP/vfxtool" build --e2e --root mygo "$RUNNER_TEMP/vfox-plus-e2e"
# tray: the icon in the tray, against the stand-in for the host of the tray icons that
# vfxtool makes: a runner has no panel.
for scenario in fake real python tray; do
xvfb-run -a -s "-screen 0 1280x800x24" dbus-run-session -- \
"$RUNNER_TEMP/vfxtool" e2e-run "$scenario" "$RUNNER_TEMP/vfox-plus-e2e"
done
xvfb-run -a -s "-screen 0 1280x800x24" dbus-run-session -- \
"$RUNNER_TEMP/vfxtool" measure "$RUNNER_TEMP/vfox-plus-e2e"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: memory-mygo
path: ${{ runner.temp }}/memory/memory.txt
if-no-files-found: error
overwrite: true
- name: Smoke test the release
run: '"$RUNNER_TEMP/vfxtool" smoke-test --log app.log mygo/build/vfox-plus'
- name: Build the .deb and the tarball
run: |
install -D -m 755 mygo/build/vfox-plus "$RUNNER_TEMP/stage/vfox-plus"
# Reproducible timestamps in the package metadata.
SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)" "$RUNNER_TEMP/vfxtool" build-deb \
--package vfox-plus --version "$(tr -d '[:space:]' < mygo/VERSION)" \
--stage "$RUNNER_TEMP/stage" --executable vfox-plus --technology mygo \
--depends "$("$RUNNER_TEMP/vfxtool" runtask print-depends)" \
--recommends "$("$RUNNER_TEMP/vfxtool" runtask print-recommends)" \
--notice mygo/assets/licenses.txt dist
- name: Validate the packages
run: |
desktop-file-validate shared/packaging/linux/dev.vfox.VfoxPlus.desktop
# CI packages carry a placeholder maintainer; releases set DEB_MAINTAINER.
lintian --fail-on error --suppress-tags malformed-contact,bogus-mail-host-in-debian-changelog dist/*.deb
- name: Install the .deb into a clean Ubuntu container
# The application must start with nothing but the declared dependencies.
run: |
docker run --rm --init \
--volume "$PWD/dist:/pkg:ro" \
--volume "$RUNNER_TEMP/vfxtool:/vfxtool:ro" \
ubuntu:26.04 /vfxtool runtask install-test
- name: Build the snap package
# The classic snap of the release, packed from this .deb as the release job packs it (see
# snap/snapcraft.yaml), with Snapcraft 9 on this runner (--destructive-mode, see the release
# job). It is built for every change, so that its base and its parts are tested before a
# release; nothing publishes it.
run: |
sudo snap install --channel=9.x/stable --classic snapcraft
cp dist/vfox-plus_*_amd64.deb snap/vfox-plus.deb
sudo /snap/bin/snapcraft pack --destructive-mode
- name: Install the snap and start it
# The application starts from the snap, with the libraries of its base, on a virtual display,
# and stays up, as the smoke test of the release does for its binary. snap run tracks an
# application of core26 through a systemd session of the user, which the user of a CI runner
# does not have (snapd refuses it), so the snap is started as root, which tracks it through
# the system bus.
run: |
sudo snap install --dangerous --classic vfox-plus_*_amd64.snap
sudo "$RUNNER_TEMP/vfxtool" smoke-test --log snap.log /snap/bin/vfox-plus
- name: Build the Linux arm64 .deb and tarball
# Like release.yml: the arm64 program is cross-compiled, and build-deb is
# told the architecture, which refuses a program of another one. The
# packages go to dist-arm64, not dist: the install test above installs
# every .deb of dist, and an arm64 package does not install on this runner.
run: |
mkdir -p "$RUNNER_TEMP/stage-linux-arm64" dist-arm64
"$RUNNER_TEMP/vfxtool" build --goos linux --goarch arm64 --root mygo "$RUNNER_TEMP/stage-linux-arm64/vfox-plus"
# Reproducible timestamps in the package metadata.
SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)" "$RUNNER_TEMP/vfxtool" build-deb \
--package vfox-plus --version "$(tr -d '[:space:]' < mygo/VERSION)" --goarch arm64 \
--stage "$RUNNER_TEMP/stage-linux-arm64" --executable vfox-plus --technology mygo \
--depends "$("$RUNNER_TEMP/vfxtool" runtask print-depends)" \
--recommends "$("$RUNNER_TEMP/vfxtool" runtask print-recommends)" \
--notice mygo/assets/licenses.txt dist-arm64
lintian --fail-on error --suppress-tags malformed-contact,bogus-mail-host-in-debian-changelog dist-arm64/*.deb
test "$(dpkg-deb -f dist-arm64/vfox-plus_*_arm64.deb Architecture)" = arm64
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: vfox-plus-linux-arm64
path: dist-arm64/*
if-no-files-found: error
- name: Cross-compile the Windows executables
# mygo needs no C compiler, so the Windows builds run on Linux.
run: |
"$RUNNER_TEMP/vfxtool" build --goos windows --goarch amd64 --root mygo "$RUNNER_TEMP/stage-x64/vfox-plus.exe"
"$RUNNER_TEMP/vfxtool" build --goos windows --goarch arm64 --root mygo "$RUNNER_TEMP/stage-arm64/vfox-plus.exe"
- name: Cross-compile the end-to-end builds for the run on Windows
# The scenarios drive the build with the tag e2e, which a release does not have, and
# vfxtool both runs them and stands in for vfox; the Windows runners below use them.
run: |
for arch in amd64 arm64; do
dir="$RUNNER_TEMP/windows-e2e/$arch"
"$RUNNER_TEMP/vfxtool" build --e2e --goos windows --goarch "$arch" --root mygo "$dir/vfox-plus-e2e.exe"
GOOS=windows GOARCH="$arch" CGO_ENABLED=0 go -C shared/tooling build -o "$dir/vfxtool.exe" ./cmd/vfxtool
done
- name: Build the unsigned .msix and .msixbundle
run: |
mkdir -p dist-windows
# Reproducible timestamps in the package metadata.
SOURCE_DATE_EPOCH="$(git log -1 --format=%ct)" "$RUNNER_TEMP/vfxtool" build-msix \
--package vfox-plus --version "$(tr -d '[:space:]' < mygo/VERSION)" \
--stage-x64 "$RUNNER_TEMP/stage-x64" --stage-arm64 "$RUNNER_TEMP/stage-arm64" \
--executable vfox-plus.exe dist-windows
- name: Stage the Windows self-sign inputs
# `vfxtool sign-msix` rebuilds the packages with the self-signed
# publisher and signs them on the user's machine, so the artifact
# carries the loose executables and a Windows vfxtool next to the
# unsigned packages.
run: |
mkdir -p dist-windows/stage-x64 dist-windows/stage-arm64
install -m 644 "$RUNNER_TEMP/stage-x64/vfox-plus.exe" dist-windows/stage-x64/vfox-plus.exe
install -m 644 "$RUNNER_TEMP/stage-arm64/vfox-plus.exe" dist-windows/stage-arm64/vfox-plus.exe
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go -C shared/tooling build -o "$PWD/dist-windows/vfxtool.exe" ./cmd/vfxtool
- name: Validate the MSIX packages
# Pure-Go validation without the Windows SDK (vfxtool validate-msix):
# ZIP layout, manifests, block maps, bundle offsets, version
# consistency and the self-sign inputs of the artifact.
run: |
ls -la dist-windows dist-windows/stage-x64 dist-windows/stage-arm64
"$RUNNER_TEMP/vfxtool" validate-msix --self-sign dist-windows
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: vfox-plus-linux-x64
path: dist/*
if-no-files-found: error
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: vfox-plus-windows
path: dist-windows/*
if-no-files-found: error
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: vfox-plus-windows-e2e
path: ${{ runner.temp }}/windows-e2e/*
if-no-files-found: error
measure-remote:
name: Measure the lightweight mode
# Forks do not run CI.
if: github.repository == 'version-fox/vfox-plus'
runs-on: ubuntu-26.04
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Read the pinned versions
run: grep -hE '^[A-Z0-9_]+=' mygo/versions.env >> "$GITHUB_ENV"
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
mygo/go.sum
shared/tooling/go.sum
- name: Install the Linux packages
# The application is a desktop application: it needs GTK 3 and a display, which
# the virtual one of xvfb gives, even to have its window drawn.
uses: ./.github/actions/install-linux-packages
with:
packages: libgtk-3-0t64 fontconfig fonts-ubuntu fonts-noto-cjk xvfb xauth dbus-x11
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Where vfxtool prepare keeps the npm package that the icons come from.
path: ~/.cache/vfox-plus/icons
key: icons-${{ hashFiles('shared/icons.json') }}
- name: Build vfxtool and the application
run: |
go -C shared/tooling build -o "$RUNNER_TEMP/vfxtool" ./cmd/vfxtool
"$RUNNER_TEMP/vfxtool" prepare --root mygo
"$RUNNER_TEMP/vfxtool" build --e2e --root mygo "$RUNNER_TEMP/vfox-plus-e2e"
- name: Measure the lightweight mode
# The private memory is written to a file of its own, uploaded as memory-lightweight-private. The
# artifact memory-lightweight keeps the lines that the report on main has always read: a line that it
# does not know would make the comment show the numbers of main for this run, as if it had none.
env:
VFOX_PLUS_MEASURE_OUTPUT: ${{ runner.temp }}/memory-lightweight/memory.txt
VFOX_PLUS_MEASURE_PRIVATE_OUTPUT: ${{ runner.temp }}/memory-lightweight-private/memory.txt
run: |
xvfb-run -a -s "-screen 0 1280x800x24" dbus-run-session -- \
"$RUNNER_TEMP/vfxtool" measure-lightweight --settle 10 "$RUNNER_TEMP/vfox-plus-e2e"
cat "${{ runner.temp }}/memory-lightweight/memory.txt"
cat "${{ runner.temp }}/memory-lightweight-private/memory.txt"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: memory-lightweight
path: ${{ runner.temp }}/memory-lightweight/memory.txt
if-no-files-found: error
overwrite: true
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: memory-lightweight-private
path: ${{ runner.temp }}/memory-lightweight-private/memory.txt
if-no-files-found: error
overwrite: true
- name: Check what the icon in the tray costs
# After the numbers are uploaded, so that a failure here leaves the report whole. A runner has no
# panel, so vfxtool stands in for the host of the tray icons, as it does in the scenario of the
# icon; the application is run without it and with it, in the same way, and fails the job when
# the icon costs more than 5 MB of resident memory or 1.5 MB of private memory: it costs
# 0.4 MB and 0.08 MB, and 7 MB and 1.8 MB where nothing shows the icon and the library falls
# back to an icon of the old kind.
run: |
xvfb-run -a -s "-screen 0 1280x800x24" dbus-run-session -- \
"$RUNNER_TEMP/vfxtool" measure-lightweight --tray --settle 10 "$RUNNER_TEMP/vfox-plus-e2e"
validate-windows:
name: Validate and install the MSIX on Windows (${{ matrix.os }})
# Forks do not run CI.
if: github.repository == 'version-fox/vfox-plus'
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025-vs2026
arch: x64
- os: windows-11-vs2026-arm
arch: arm64
runs-on: ${{ matrix.os }}
timeout-minutes: 25
needs: [unit, build]
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: vfox-plus-windows
path: msix
- name: Validate the bundle
# The checks of a release (vfxtool validate-msix), on the packages that this job
# downloads: the unsigned bundle with both architectures, and the self-sign inputs.
shell: pwsh
run: |
& msix/vfxtool.exe validate-msix --self-sign msix
if ($LASTEXITCODE -ne 0) { throw "validate-msix failed with exit code $LASTEXITCODE" }
- name: Install and uninstall the bundle
# UAC is disabled on GitHub-hosted runners, so the unsigned install for all users runs
# without a prompt. The deployment platform picks the slice of this runner, which proves
# each architecture. install-check prints the AppX deployment log when the install fails.
shell: pwsh
run: |
& msix/vfxtool.exe install-check --directory msix --arch ${{ matrix.arch }}
if ($LASTEXITCODE -ne 0) { throw "install-check failed with exit code $LASTEXITCODE" }
- name: Sign, install and uninstall the bundle with vfxtool install-check --signed
# What a user runs on a Windows machine: sign-msix rebuilds the packages with the publisher
# of a certificate that it makes, signs them with the pinned osslsigncode that it downloads,
# trusts the certificate for the machine and installs the bundle without -AllowUnsigned. A
# second run must replace the certificate of the first. install-check does the checks; the
# runner is an administrator with UAC off, and sign-msix runs with -no-relaunch.
shell: pwsh
run: |
& msix/vfxtool.exe install-check --directory msix --arch ${{ matrix.arch }} --signed
if ($LASTEXITCODE -ne 0) { throw "install-check --signed failed with exit code $LASTEXITCODE" }
tray-gnome:
name: Run the icon in the tray on GNOME
# Forks do not run CI.
if: github.repository == 'version-fox/vfox-plus'
runs-on: ubuntu-26.04
timeout-minutes: 40
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Read the pinned versions
run: grep -hE '^[A-Z0-9_]+=' mygo/versions.env >> "$GITHUB_ENV"
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
mygo/go.sum
shared/tooling/go.sum
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Where vfxtool prepare keeps the npm package that the icons come from.
path: ~/.cache/vfox-plus/icons
key: icons-${{ hashFiles('shared/icons.json') }}
- name: Build vfxtool and the end-to-end build of the application
# No package of the runner is needed: the application is built without a C compiler, and it
# runs in the container below, which has what it loads.
run: |
go -C shared/tooling build -o "$RUNNER_TEMP/vfxtool" ./cmd/vfxtool
"$RUNNER_TEMP/vfxtool" prepare --root mygo
"$RUNNER_TEMP/vfxtool" build --e2e --root mygo "$RUNNER_TEMP/vfox-plus-e2e"
- name: Build the image of a GNOME Shell with no screen
# Ubuntu's GNOME Shell and its AppIndicator extension, the library of the icon, and an
# ordinary user (shared/sandbox/gnome.Dockerfile).
run: docker build --tag vfox-plus-gnome --file shared/sandbox/gnome.Dockerfile shared/sandbox
- name: Run the icon in the tray on the shell
# vfxtool gnome-session starts the shell and its extension inside the container, as root
# (it makes the system bus that the shell wants) and then as the user of the session, and runs the
# scenario on the display of the shell: the application closes its window, the shell puts its icon
# in its panel and makes the menu of it, chooses its entries as the user does, and the application
# does what they say. The repository is mounted for the captured output of vfox that the scenario uses.
run: |
docker run --rm --init \
--volume "$PWD:/repo:ro" \
--volume "$RUNNER_TEMP/vfxtool:/usr/local/bin/vfxtool:ro" \
--volume "$RUNNER_TEMP/vfox-plus-e2e:/usr/local/bin/vfox-plus-e2e:ro" \
--workdir /repo \
vfox-plus-gnome \
vfxtool gnome-session vfxtool e2e-run tray-gnome /usr/local/bin/vfox-plus-e2e
gateway:
name: Run the image of the gateway against the application
# Forks do not run CI.
if: github.repository == 'version-fox/vfox-plus'
runs-on: ubuntu-26.04
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Read the pinned versions
run: grep -hE '^[A-Z0-9_]+=' mygo/versions.env >> "$GITHUB_ENV"
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
mygo/go.sum
shared/tooling/go.sum
- name: Install the Linux packages
# The application is a desktop application: it needs GTK 3 and a display, which the virtual one
# of xvfb gives, even to have its window drawn. The gateway is not: it is the image.
uses: ./.github/actions/install-linux-packages
with:
packages: libgtk-3-0t64 fontconfig fonts-ubuntu fonts-noto-cjk xvfb xauth dbus-x11
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
# Where vfxtool prepare keeps the npm package that the icons come from.
path: ~/.cache/vfox-plus/icons
key: icons-${{ hashFiles('shared/icons.json') }}
- name: Build vfxtool and the end-to-end build of the application
run: |
go -C shared/tooling build -o "$RUNNER_TEMP/vfxtool" ./cmd/vfxtool
"$RUNNER_TEMP/vfxtool" prepare --root mygo
"$RUNNER_TEMP/vfxtool" build --e2e --root mygo "$RUNNER_TEMP/vfox-plus-e2e"
- name: Build the image of the gateway
# With the defaults of the Dockerfile, which are what the people who build it get: they have to be
# the versions pinned in mygo/versions.env.
run: |
grep -Fx "ARG GO_VERSION=$GO_VERSION" mygo/Dockerfile
grep -Fx "ARG GO_SHA256=$GO_SHA256" mygo/Dockerfile
docker build --tag vfox-plus-gateway --file mygo/Dockerfile mygo
- name: Run the gateway against the application
# vfxtool gateway-check starts the application with other devices allowed,
# runs the image as a container with a volume of its own, and does what a person does at a browser:
# pairs it with the link in the log of the container, pastes a link of the application, compares the
# fingerprint of the certificate and uses the application through the gateway. It stops the container
# with docker stop while the interface is open, starts it again, and ends the application.
run: |
xvfb-run -a -s "-screen 0 1280x800x24" dbus-run-session -- \
"$RUNNER_TEMP/vfxtool" gateway-check --image vfox-plus-gateway "$RUNNER_TEMP/vfox-plus-e2e"
run-windows:
name: Run the application on Windows (${{ matrix.os }})
# Forks do not run CI.
if: github.repository == 'version-fox/vfox-plus'
strategy:
fail-fast: false
matrix:
include:
- os: windows-2025-vs2026
arch: amd64
- os: windows-11-vs2026-arm
arch: arm64
runs-on: ${{ matrix.os }}
timeout-minutes: 25
needs: [unit, build]
steps:
# The scenarios find the captured output of vfox in the repository.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: vfox-plus-windows-e2e
path: e2e
- name: Run the application against the fake vfox
# The window of the application is drawn on the desktop of the runner and driven through
# the automation plugin of mygo, as on Linux: the Home page, the versions of Node.js, using
# one and installing another. vfxtool.exe is the fake vfox of the scenario, too.
shell: pwsh
run: |
$dir = Join-Path $PWD "e2e/${{ matrix.arch }}"
& "$dir/vfxtool.exe" e2e-run fake "$dir/vfox-plus-e2e.exe"
if ($LASTEXITCODE -ne 0) { throw "the fake scenario failed with exit code $LASTEXITCODE" }
- name: Run the application on a machine with Python
# The options of Python, with the install method that the row changes, and the filter of the
# GraalPy builds in the versions: the layout of the dialogs and the chips on Windows.
shell: pwsh
run: |
$dir = Join-Path $PWD "e2e/${{ matrix.arch }}"
& "$dir/vfxtool.exe" e2e-run python "$dir/vfox-plus-e2e.exe"
if ($LASTEXITCODE -ne 0) { throw "the python scenario failed with exit code $LASTEXITCODE" }
- name: Run the icon in the tray
# The application closes its window in the lightweight mode and runs on; the notification
# area of the taskbar of the runner has to give its icon a place, the window comes back, and
# the application ends as the menu of the icon asks.
shell: pwsh
run: |
$dir = Join-Path $PWD "e2e/${{ matrix.arch }}"
& "$dir/vfxtool.exe" e2e-run tray "$dir/vfox-plus-e2e.exe"
if ($LASTEXITCODE -ne 0) { throw "the tray scenario failed with exit code $LASTEXITCODE" }
census:
name: Take the census of the screens (${{ matrix.os }}, ${{ matrix.group }})
# What holds text is as wide as the text, which a platform sets in its own engine and fonts (Pango on Linux,
# DirectWrite on Windows, Core Text on macOS), and a version of a platform has its own: each draws every screen and
# holds it to the budgets of the design system, in English and in Chinese, at every size of text that the sweep
# names, in the widest fonts that the machine has, and in a text made wider than any font. The census of the newest
# Ubuntu is a step of the job build;
# here it takes the rest, with the fonts that the desktops of Linux set their text in installed, and the others
# take it all. Of Windows and of macOS the newest and the oldest that GitHub has are taken (windows-2022 is Windows
# Server 2022, macos-15 is macOS 15), and the other architecture of each: windows-11-vs2026-arm, and macos-15-intel.
#
# The tests are four jobs on each machine, and five on Intel, not one: the screens (the census with the fonts of the system, and on
# Intel the text made wider in a job of its own), the widest fonts, and the sweep of the sizes of text in two jobs, the windows of
# 1280 dp, which take half of the sweep, and the others. A machine runs them at once, and a run of the census is as long as the
# longest of them, not as long as their sum.
# Forks do not run CI.
if: github.repository == 'version-fox/vfox-plus'
strategy:
fail-fast: false
matrix:
# On the macOS runners five jobs ran at once in the run at 3b3bcd7, and the jobs of Intel, which take the longest, waited
# behind the others: the matrix lists the longest machine and its longest group first, so that the queue starts with them.
os: [macos-15-intel, macos-15, macos-latest, ubuntu-26.04, windows-2025-vs2026, windows-2022, windows-11-vs2026-arm]
group: [census, sweep-rest, widest, sweep-wide]
# On Intel the census is two jobs, the screens with the fonts of the system and the text made wider: the Intel census was the
# longest job of the workflow (30 minutes on the run at d37bec8), and the others of Intel take up to fifteen.
exclude:
- os: macos-15-intel
group: census
include:
- group: census
run: 'TestTheScreensAreWithinTheBudgets$|TestTheScreensAreWithinTheBudgetsInTheFontsThatTheSystemChooses|TestTheScreensAreWithinTheBudgetsInATextThatIsWider'
- group: widest
run: 'TestTheScreensAreWithinTheBudgetsInTheWidestFontsThatTheSystemHas'
- group: sweep-wide
run: 'TestTheScreensAreWithinTheBudgetsAtEverySizeOfText/\.wide-'
- group: sweep-rest
run: 'TestTheScreensAreWithinTheBudgetsAtEverySizeOfText/\.(narrow|compact|medium)-'
- os: macos-15-intel
group: census
run: 'TestTheScreensAreWithinTheBudgets$|TestTheScreensAreWithinTheBudgetsInTheFontsThatTheSystemChooses'
- os: macos-15-intel
group: wider
run: 'TestTheScreensAreWithinTheBudgetsInATextThatIsWider'
- os: ubuntu-26.04
fonts: >-
fonts-adwaita-sans fonts-cantarell fonts-noto-core fonts-inter fonts-open-sans fonts-roboto fonts-lato
fonts-liberation2 fonts-freefont-ttf
runs-on: ${{ matrix.os }}
# The slowest of the machines, macOS 15 on Intel, took 44 minutes for all of the tests on the run at da7d186, before the sweep was
# split in two. The tests of a group have 65 minutes, and the job an hour and a quarter.
timeout-minutes: 75
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Read the pinned versions
shell: bash
run: grep -hE '^[A-Z0-9_]+=' mygo/versions.env >> "$GITHUB_ENV"
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
mygo/go.sum
shared/tooling/go.sum
- name: Install the Linux packages
# The fonts that the desktops of Linux set their text in are installed beside the ones of the application: the
# census takes the widest of the fonts that a machine has.
if: runner.os == 'Linux'
uses: ./.github/actions/install-linux-packages
with:
packages: ${{ env.LINUX_PACKAGES }} ${{ matrix.fonts }}
- name: Show the system
# What a run is of, in its log: the version of the system that its text engine and its fonts are those of.
shell: bash
run: |
uname -srm
if [ "$RUNNER_OS" = Linux ]; then . /etc/os-release && echo "$PRETTY_NAME"; fi
if [ "$RUNNER_OS" = macOS ]; then sw_vers; fi
if [ "$RUNNER_OS" = Windows ]; then cmd //c ver; fi
- name: Prepare the embedded assets
# The icons and the translations: the licenses of the modules are not what a census reads.
id: prepare
shell: bash
env:
MYGO_SKIP_LICENSES: '1'
run: go -C shared/tooling run ./cmd/vfxtool prepare --root "$GITHUB_WORKSPACE/mygo"
- name: Take the census
# The screens of the census, in the fonts that the platform gives for sans-serif and monospace and in the widest that
# the machine has, in a text made wider than any font, and the sizes of text between the ones of the census, in
# English and in Chinese. The log has the census of each screen.
working-directory: mygo
shell: bash
env:
VFOX_PLUS_CENSUS_SWEEP: '1'
VFOX_PLUS_CENSUS: ${{ runner.temp }}/census
# Every picture of the screens is kept only by a run that is asked for by hand; a screen that is over a budget keeps its
# picture in the census directory, which the last step uploads when the run fails.
VFOX_PLUS_SNAPSHOTS: ${{ github.event_name == 'workflow_dispatch' && format('{0}/census', runner.temp) || '' }}
TESTS: ${{ matrix.run }}
run: |
go test ./ui -run "$TESTS" -count=1 -timeout 65m -v 2>&1 | tee "$RUNNER_TEMP/census-output.txt"
# A pattern that matches no test, or no subtest of the tests that it matches, passes without a screen: a group that
# runs no screen has not taken the census.
if ! grep -q -- '=== RUN .*/' "$RUNNER_TEMP/census-output.txt"; then
echo "the pattern of the group runs no screen: $TESTS"
exit 1
fi
- name: Test the kit
# The components measure the text and wrap by what they measure, whatever it is set in: what their tests hold is the
# same on every platform. It runs when the census did not pass, too, so that a run says both.
if: ${{ !cancelled() && steps.prepare.conclusion == 'success' }}
working-directory: mygo
shell: bash
run: go test ./ui/kit -count=1
- name: Keep the pictures of the screens
# When a screen is over a budget, to look at it; and when a run is asked for by hand.
if: failure() || github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: census-${{ matrix.os }}-${{ matrix.group }}
path: ${{ runner.temp }}/census
retention-days: 7
if-no-files-found: ignore