Repository navigation
238 lines (212 loc) · 8.09 KB
/
Copy pathci.yml
File metadata and controls
238 lines (212 loc) · 8.09 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
racket-version: ['9.3']
steps:
- uses: actions/checkout@v4
- name: Install Racket
uses: Bogdanp/setup-racket@v1.11
with:
version: ${{ matrix.racket-version }}
- name: Install Glaze package
shell: bash
run: raco pkg install --auto --no-docs --link "$PWD"
- name: Run tests
run: raco test glaze-test/
- name: Build Scribble documentation
if: runner.os == 'Linux'
shell: bash
run: |
mkdir -p "$RUNNER_TEMP/glaze-doc"
raco scribble ++xref-in setup/xref load-collections-xref \
--htmls --dest "$RUNNER_TEMP/glaze-doc" \
glaze-doc/scribblings/glaze.scrbl
- name: Check formatting
shell: bash
run: |
raco pkg install --auto --no-docs fmt
python - <<'PY'
from pathlib import Path
import subprocess
for root in ("glaze", "glaze-cli", "glaze-test"):
for path in Path(root).rglob("*.rkt"):
subprocess.run(["raco", "fmt", "-i", str(path)], check=True)
PY
git diff --exit-code -- glaze glaze-cli glaze-test
webview-e2e:
# Real-window WebView end-to-end on each OS: open -> load (title
# commits) -> capture -> navigate -> close -> on-close. Windows needs
# nothing extra (WebView2 runtime is preinstalled); Linux runs under
# Xvfb with the WebKitGTK packages.
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
racket-version: ['9.3']
steps:
- uses: actions/checkout@v4
- name: Install Racket
uses: Bogdanp/setup-racket@v1.11
with:
version: ${{ matrix.racket-version }}
- name: Install Glaze package
shell: bash
run: raco pkg install --auto --no-docs --link "$PWD"
- name: Install webview deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev xvfb
- name: Probe webview libraries (Linux debug)
if: runner.os == 'Linux'
run: ldconfig -p | grep -E "libgtk-3|libwebkit2gtk|libglib-2.0|libgdk_pixbuf" | head -10
- name: Run webview e2e
env:
WEBKIT_DISABLE_DMABUF_RENDERER: '1'
shell: bash
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
xvfb-run -a racket scripts/webview-e2e.rkt
else
racket scripts/webview-e2e.rkt
fi
- name: Run agent-native diagnosis and verification
env:
WEBKIT_DISABLE_DMABUF_RENDERER: '1'
shell: bash
run: |
cd "$RUNNER_TEMP"
raco glaze init agent-smoke
cd agent-smoke
test -f AGENTS.md
test -f verify.rkt
raco glaze inspect --json > inspect.json
python - <<'PY'
import json
with open("inspect.json", encoding="utf-8") as source:
report = json.load(source)
assert report["contract-version"] == 1
assert report["application"]["instructions"]["exists"] is True
PY
if [ "$RUNNER_OS" = "Linux" ]; then
xvfb-run -a raco glaze doctor --json
xvfb-run -a raco glaze verify
else
raco glaze doctor --json
raco glaze verify
fi
package:
# Build a sample app with `raco glaze build --installer` on each platform
# and upload the resulting distribution + installer as artifacts.
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
racket-version: ['9.3']
steps:
- uses: actions/checkout@v4
- name: Install Racket
uses: Bogdanp/setup-racket@v1.11
with:
version: ${{ matrix.racket-version }}
- name: Install Glaze package
shell: bash
run: raco pkg install --auto --no-docs --link "$PWD"
- name: Install installer toolchain (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libayatana-appindicator3-dev libgtk-3-dev
# AppImage tooling (optional; build falls back to tar.gz if missing)
sudo wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool
sudo chmod +x /usr/local/bin/appimagetool
- name: Install installer toolchain (Windows)
if: runner.os == 'Windows'
run: |
# Pin the same WiX release used by the tag-release workflow.
dotnet tool install --global wix --version 5.0.2
echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Scaffold and build a sample app
shell: bash
run: |
raco glaze init sampleapp
cd sampleapp
test -f AGENTS.md
test -f verify.rkt
raco glaze inspect --json > inspect.json
python - <<'PY'
import json
with open("inspect.json", encoding="utf-8") as source:
report = json.load(source)
assert report["contract-version"] == 1
assert report["application"]["entry"]["exists"] is True
PY
# --sign - exercises the signing pipeline everywhere: macOS signs
# the bundle ad-hoc (verifiable without a cert); Windows/Linux
# degrade with a loud warning when no signing toolchain exists.
raco glaze build --name sampleapp --version 0.0.1 \
--publisher "Turing Lambda" --identifier TuringLambda.Glaze.CISample \
--out dist --installer --sign -
- name: Validate Windows installer upgrade identity
if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$first = (Resolve-Path 'sampleapp/dist/sampleapp.msi').Path
wix msi validate $first
Push-Location sampleapp
raco glaze build `
--name sampleapp `
--version 0.0.2 `
--publisher 'Turing Lambda' `
--identifier TuringLambda.Glaze.CISample `
--out dist-next `
--installer
Pop-Location
$second = (Resolve-Path 'sampleapp/dist-next/sampleapp.msi').Path
wix msi validate $second
$firstWxs = Join-Path $env:RUNNER_TEMP 'sampleapp-0.0.1.wxs'
$secondWxs = Join-Path $env:RUNNER_TEMP 'sampleapp-0.0.2.wxs'
wix msi decompile $first -o $firstWxs
wix msi decompile $second -o $secondWxs
[xml] $firstXml = Get-Content -Raw $firstWxs
[xml] $secondXml = Get-Content -Raw $secondWxs
$firstPackage = $firstXml.Wix.Package
$secondPackage = $secondXml.Wix.Package
if ($firstPackage.UpgradeCode -ne $secondPackage.UpgradeCode) {
throw 'UpgradeCode changed between consecutive versions'
}
if ($firstPackage.ProductCode -eq $secondPackage.ProductCode) {
throw 'ProductCode did not change between consecutive versions'
}
if ($secondPackage.Version -ne '0.0.2') {
throw "unexpected MSI version: $($secondPackage.Version)"
}
- name: Verify macOS bundle signature
if: runner.os == 'macOS'
run: |
codesign --verify --strict sampleapp/dist/sampleapp.app
/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" sampleapp/dist/sampleapp.app/Contents/Info.plist | grep -qx "0.0.1"
- name: Upload distribution
uses: actions/upload-artifact@v4
with:
name: glaze-${{ runner.os }}-dist
path: |
sampleapp/dist/
sampleapp/*.zip
sampleapp/*.tar.gz
sampleapp/dist/*.msi
sampleapp/dist/*.dmg
sampleapp/dist/*.AppImage