-
Notifications
You must be signed in to change notification settings - Fork 120
383 lines (345 loc) · 16.1 KB
/
Copy pathextended_checks.yml
File metadata and controls
383 lines (345 loc) · 16.1 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
name: extended checks
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
###########################################################
pre_job:
###########################################################
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content'
do_not_skip: '["pull_request", "workflow_dispatch"]'
###########################################################
extended_checks:
###########################################################
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ${{ matrix.runner }}
# actions: write needed for `gh cache delete` in the sccache refresh step.
permissions:
contents: read
actions: write
strategy:
fail-fast: false
matrix:
target: [linux, darwin15, windows]
architecture: [64, arm64]
include:
- target: linux
runner: ubuntu-latest
build_system: cmake
cmake_generator: Ninja
- target: darwin15
architecture: arm64
runner: macos-15
architecture_string: arm64
build_system: cmake
cmake_generator: Ninja
- target: windows
runner: windows-latest
build_system: cmake
cmake_generator: Ninja
architecture_string: x64
exclude:
- target: linux
architecture: arm64
- target: windows
architecture: arm64
- target: darwin15
architecture: 64
steps:
- name: "SCM Checkout"
uses: actions/checkout@v4
with:
# Full history so the lint step can `git diff` against the PR base branch.
fetch-depth: 0
- name: "Exclude workspace from Windows Defender"
if: runner.os == 'Windows'
shell: pwsh
continue-on-error: true
# Defender real-time scan of freshly-written .obj/.exe/.dll slows the build
# and can momentarily lock a just-linked exe (the "Access is denied" deploy
# race). Exclude the workspace + toolchain writers and try to disable RTP;
# the status dump records whether the runner image actually honored it
# (managed Defender / Tamper Protection may silently no-op).
# continue-on-error: a managed-Defender runner must not fail CI.
run: |
Add-MpPreference -ExclusionPath "${{ github.workspace }}" -ErrorAction SilentlyContinue
foreach ($p in 'daslang.exe','daslang_static.exe','test_aot.exe','cl.exe','link.exe','lld-link.exe','mt.exe','vctip.exe','mspdbsrv.exe','vcpkg.exe') {
Add-MpPreference -ExclusionProcess $p -ErrorAction SilentlyContinue
}
Set-MpPreference -DisableRealtimeMonitoring $true -ErrorAction SilentlyContinue
Get-MpComputerStatus | Select-Object RealTimeProtectionEnabled, IsTamperProtected
Get-MpPreference | Select-Object -ExpandProperty ExclusionPath
- name: "Install CMake and Ninja"
uses: lukka/get-cmake@latest
- if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: "Install: Required Dev Packages"
run: |
set -eux
case "${{ matrix.target }}" in
darwin15)
brew install bison openssl
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/bison/lib -L$(brew --prefix openssl)/lib"
export CPPFLAGS="-I$(brew --prefix openssl)/include"
;;
linux)
echo "MARCH=64" >> $GITHUB_ENV
# apt.llvm.org provides LLVM 22 packages for Noble (not yet in main archive).
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
| sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/llvm.gpg
echo 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main' \
| sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update -y
sudo apt-get install --no-install-recommends -y \
mesa-common-dev \
libglu1-mesa-dev \
libgl1-mesa-dev \
libglfw3-dev \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxinerama-dev \
libxi-dev \
llvm-22-dev
;;
esac
- name: "Cache vcpkg + openssl"
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
# vcpkg.exe + ports/triplets/scripts + installed/<triplet>/openssl. Key is
# shared with build.yml so this reads build.yml's master-seeded slot.
path: vcpkg
key: vcpkg-x64-windows-v2
- name: "Install openssl (Windows)"
if: runner.os == 'Windows'
run: |
if [ ! -x vcpkg/vcpkg.exe ] && [ ! -x vcpkg/vcpkg ]; then
git clone https://github.com/microsoft/vcpkg && ./vcpkg/bootstrap-vcpkg.sh
fi
./vcpkg/vcpkg install openssl:x64-windows --binarycaching
echo "VCPKG_ROOT=$(pwd)/vcpkg" >> $GITHUB_ENV
# Drop build intermediates so the saved cache holds only installed/ — ~1.2GiB -> ~0.1GiB.
rm -rf vcpkg/buildtrees vcpkg/downloads vcpkg/packages
# sccache with LOCAL-DISK backend, wrapped in ONE actions/cache entry per
# matrix config — mirrors build.yml. The GHA backend writes one cache item
# per TU (quota fragmentation, frequent concurrent-write failures); local
# disk keeps all objects in $SCCACHE_DIR persisted as a single tarball.
# Windows MSVC compiles are cacheable because daslang builds /Z7
# (CMakeCommon.txt) — debug info embedded in the .obj; sccache refuses /Zi.
- uses: mozilla-actions/sccache-action@v0.0.10
- run: |
echo "SCCACHE_DIR=${{ runner.temp }}/sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=false" >> $GITHUB_ENV
# Non-Windows: export the launcher via env (also wraps the GLFW/libhv
# ExternalProject sub-builds — harmless on gcc/clang). Windows must NOT
# export it: the env leaks into the sub-cmakes where sccache + MSVC /Zi
# (those sub-builds keep /Zi) + parallel Ninja collide on the shared
# glfw.pdb (C1041). Windows passes the launcher as -D on the main
# configure only (Build step), scoping sccache to daslang's /Z7 TUs.
if [ "$RUNNER_OS" != "Windows" ]; then
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
fi
# Stable per-config key in its own `sccache-extended-*` namespace so it never
# clobbers build.yml's slots. Restore always; save only on master (delete
# first — GHA caches are immutable, so a plain save under an existing key is
# a no-op). PRs read-only.
- name: "Restore sccache objects"
uses: actions/cache/restore@v4
with:
path: ${{ runner.temp }}/sccache
key: sccache-extended-${{ matrix.target }}-${{ matrix.architecture }}
- name: "Build: Daslang (Release)"
run: |
set -eux
ACTIVE_MODULES=$(grep -v "^#" ci/release_modules.txt | cut -d':' -f2 | sed 's|^|-D|' | xargs)
case "${{ matrix.target }}" in
windows)
# Ninja single-config: binaries land in ./bin (not ./bin/Release);
# cl.exe is on PATH via the msvc-dev-cmd step; OpenSSL comes from
# vcpkg so dasHV skips its perl+nmake source build.
echo "BIN=./bin" >> $GITHUB_ENV
export PATH="/c/Strawberry/perl/bin:$PATH"
# Launcher passed as -D here (not env) so it scopes to daslang's own
# /Z7 targets and does NOT leak into the GLFW/libhv /Zi sub-builds.
cmake --no-warn-unused-cli -B./build -G "${{ matrix.cmake_generator }}" -DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
$ACTIVE_MODULES -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build ./build --config Release --target daslang das-fmt daslang_static --parallel
;;
linux)
echo "BIN=./bin" >> $GITHUB_ENV
# dasClangBind stays OFF here — its libclang.so pulls in
# libLLVM-22.so.1 which collides with dasLLVM's own use of
# the same .so (shared LLVM pass registry → double init,
# breaks dasbind_example JIT-to-exe). dasClangBind is built
# and self-binder-checked on the mingw worker (build.yml)
# where it links against msys2's libclang and there is no
# dasLLVM in the same process.
CC=clang CXX=clang++ cmake --no-warn-unused-cli -B./build \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.architecture_string }}" \
-DDAS_CLANG_BIND_DISABLED=ON \
-DDAS_GLFW_DISABLED=OFF \
-G "${{ matrix.cmake_generator }}" $ACTIVE_MODULES
cmake --build ./build --config Release --target daslang daslang_static
;;
*)
echo "BIN=./bin" >> $GITHUB_ENV
CC=clang CXX=clang++ cmake --no-warn-unused-cli -B./build \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_OSX_ARCHITECTURES="${{ matrix.architecture_string }}" \
-DDAS_GLFW_DISABLED=OFF \
-G "${{ matrix.cmake_generator }}" $ACTIVE_MODULES
cmake --build ./build --config Release --target daslang daslang_static
;;
esac
- name: "Refresh sccache slot"
if: github.ref == 'refs/heads/master'
env:
GH_TOKEN: ${{ github.token }}
SCKEY: sccache-extended-${{ matrix.target }}-${{ matrix.architecture }}
run: gh cache delete "$SCKEY" -R ${{ github.repository }} || true
- name: "Save sccache objects"
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/sccache
key: sccache-extended-${{ matrix.target }}-${{ matrix.architecture }}
- name: "Install ast-grep"
run: npm install -g @ast-grep/cli
- name: "Run dasgen and check generated files are up to date"
run: cmake --build ./build --config Release --target check_dasgen
- name: "Run examples from modules"
run: cmake --build ./build --config Release --target run_examples
- name: "Run utils tests"
run: cmake --build ./build --config Release --target run_utils_tests
- name: "Run tutorial dry-runs"
run: cmake --build ./build --config Release --target dry_run_tutorials
- name: "Build standalone executables"
run: |
set -eux
cmake --build ./build --config Release --target all_utils_exe
$BIN/daslang -exe -output ./bin/das-fmt ./utils/das-fmt/dasfmt.das
$BIN/daslang -exe -output ./bin/das-lint ./utils/lint/main.das
- name: "Sequence release smoke test"
# Full daspkg install -> release -> launch cycle on the in-tree sequence
# game. Exercises release_include_dll + the loader fixes (Windows
# LoadLibraryEx, POSIX rpath $ORIGIN / @loader_path) end-to-end.
# Lives in extended_checks (not build.yml) because sequence transitively
# requires dasHV, which is DAS_HV_DISABLED=ON by default and only flipped
# ON via ci/release_modules.txt in this workflow.
run: |
set -eux
# The main extended_checks build only targets daslang/das-fmt/daslang_static.
# Sequence loads dasGlfw + dasLiveHost + dasHV + dasAudio + dasPUGIXML +
# dasStbImage at runtime; build their dynamic-module targets first.
# No `cmake --install` -- the source tree already IS a usable daslang
# root after build (bin/daslang via EXECUTABLE_OUTPUT_PATH; modules/<X>/
# .shared_module via ADD_DAS_SHARED_MODULE_LIB output dirs; utils/daspkg
# lives in the source tree). cmake --install would also try to install
# daslang-live which extended_checks doesn't build.
cmake --build ./build --config Release --target \
dasModuleGlfw dasModuleLiveHost dasModuleHV dasModuleAudio \
dasModulePUGIXML dasModuleStbImage --parallel
case "${{ matrix.target }}" in
windows)
pwsh examples/games/sequence/ci_smoke_test.ps1 "$(pwd)"
;;
linux)
sudo apt-get install -y xvfb
xvfb-run -a bash examples/games/sequence/ci_smoke_test.sh "$(pwd)"
;;
*)
bash examples/games/sequence/ci_smoke_test.sh "$(pwd)"
;;
esac
- name: "Run formatter"
run: |
set -eux
cmake --build ./build --config Release --target check_format
$BIN/das-fmt.exe --path ./ --verify
- name: "Run lint on changed .das files"
if: matrix.target == 'linux'
run: |
set -eux
BASE_REF="${{ github.event.pull_request.base.ref }}"
BASE_REF="${BASE_REF:-master}"
mapfile -t CHANGED < <(git diff --name-only --diff-filter=AM "origin/${BASE_REF}...HEAD" -- '*.das')
if [ ${#CHANGED[@]} -eq 0 ]; then
echo "no .das files changed; skipping lint"
exit 0
fi
echo "linting: ${CHANGED[*]}"
$BIN/daslang ./utils/lint/main.das -- "${CHANGED[@]}" --quiet
$BIN/das-lint.exe "${CHANGED[@]}" --quiet
- name: "Test daslang_static"
run: |
set -eux
$BIN/daslang_static _dasroot_/dastest/dastest.das -- --color --failures-only --test ./tests
- name: "Test ser/deser"
run: |
$BIN/daslang _dasroot_/dastest/dastest.das -- --color --failures-only --test ./tests --ser serialized.bin
$BIN/daslang _dasroot_/dastest/dastest.das -- --color --failures-only --test ./tests --deser serialized.bin
- name: "Test MCP tools"
if: matrix.target == 'linux'
run: |
set -eux
$BIN/daslang _dasroot_/dastest/dastest.das -- --color --failures-only --test ./utils/mcp/test_tools.das
$BIN/daslang _dasroot_/dastest/dastest.das -- --color --failures-only --test ./utils/mcp/test_crosstree_guard.das
- name: "Test LSP cross-tree guard (python)"
if: matrix.target == 'linux'
run: |
set -eux
python3 utils/lsp/test_crosstree_guard.py
- name: "Test dasllama-server"
# OpenAI-compatible server conformance test. Model-gated + JIT-only, so it
# skips cleanly here (no GGUF, no -jit) — the value is the compile guard:
# it exercises the dasHV + dasAudio + dasllama facade surface the server
# reaches, catching any API/module breakage in CI.
if: matrix.target == 'linux'
run: |
set -eux
$BIN/daslang _dasroot_/dastest/dastest.das -- --color --failures-only --test ./utils/dasllama-server/test_openai_server.das
# Self-binders for dasClangBind + dasLLVM bindings live on the mingw
# worker (build.yml build_windows_mingw) — see comment on the linux
# build step above for why dasClangBind can't be enabled here.
- name: "Install dasImgui (daspkg)"
run: |
set -eux
$BIN/daslang utils/daspkg/main.das -- install dasImgui --branch master
# Disabled — dasImgui will land its own self-binder freshness check inside its own repo's CI.
# - name: "Run self-binder (bind_imgui.das)"
# if: matrix.target == 'linux'
# run: |
# set -eux
# $BIN/daslang modules/dasImgui/bind/bind_imgui.das
# cd modules/dasImgui && git diff --exit-code -- src/ \
# || (echo "ERROR: dasImgui generated files are out of date. Run './bin/daslang modules/dasImgui/bind/bind_imgui.das' locally and commit the result." && exit 1)
- name: "Coverage"
if: matrix.target == 'linux'
run: |
$BIN/daslang dastest/dastest.das -- --cov-path coverage.lcov --color --test ./tests/language --timeout 1800
$BIN/dascov.exe -- coverage.lcov --exclude tests/language