forked from GaijinEntertainment/daScript
-
Notifications
You must be signed in to change notification settings - Fork 0
281 lines (250 loc) · 11 KB
/
extended_checks.yml
File metadata and controls
281 lines (250 loc) · 11 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
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-fat
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 }}
strategy:
fail-fast: false
matrix:
target: [linux, darwin15, windows]
architecture: [64, arm64]
include:
- target: linux
runner: ubuntu-latest-fat
build_system: cmake
cmake_generator: Ninja
- target: darwin15
architecture: arm64
runner: macos-15-xlarge
architecture_string: arm64
build_system: cmake
cmake_generator: Ninja
- target: windows
runner: windows-latest-fat
build_system: cmake
cmake_generator: Visual Studio 17 2022
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: "Install CMake and Ninja"
uses: lukka/get-cmake@latest
- if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: "Install: Required Dev Packages"
run: |
set -eux
case "${{ matrix.target }}" in
darwin15)
# z3: runtime dep baked into prebuilt LLVM.dll's install_name on macOS arm64.
brew install bison openssl z3
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: "Install openssl (Windows)"
if: runner.os == 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg && ./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install openssl:x64-windows --binarycaching
echo "VCPKG_ROOT=$(pwd)/vcpkg" >> $GITHUB_ENV
- 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)
echo "BIN=./bin/Release" >> $GITHUB_ENV
export PATH="/c/Strawberry/perl/bin:$PATH"
cmake --no-warn-unused-cli -B./build -G "${{ matrix.cmake_generator }}" -T host=x64 -A ${{ matrix.architecture_string }} \
$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: "Install ast-grep"
run: npm install -g @ast-grep/cli
- name: "Run dasgen and check generated files are up to date"
run: |
set -eux
$BIN/daslang dasgen/gen_bind.das
git diff --exit-code -- include/daScript/builtin/ \
|| (echo "ERROR: Generated .inc files are out of date. Run './bin/daslang dasgen/gen_bind.das' locally and commit the result." && exit 1)
- 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
$BIN/daslang ./utils/das-fmt/dasfmt.das -- --path ./ --verify
$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
# 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