Skip to content

Merge pull request #2688 from GaijinEntertainment/bbatkin/live-api-dr… #314

Merge pull request #2688 from GaijinEntertainment/bbatkin/live-api-dr…

Merge pull request #2688 from GaijinEntertainment/bbatkin/live-api-dr… #314

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
- 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 \
libclang-16-dev \
llvm-16-dev \
clang-16 \
libclang-22-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
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=OFF \
-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
- 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: "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: "Run self-binder (bind_clangbind.das)"
if: matrix.target == 'linux'
run: |
set -eux
$BIN/daslang modules/dasClangBind/bind/bind_clangbind.das -- --clang_path /usr/lib/llvm-16/include/
git diff --exit-code -- modules/dasClangBind/src/ \
|| (echo "ERROR: dasClangBind generated files are out of date. Run './bin/daslang modules/dasClangBind/bind/bind_clangbind.das -- --clang_path <libclang-include-path>' locally and commit the result." && exit 1)
- name: "Run self-binder (bind_llvm.das)"
if: matrix.target == 'linux'
run: |
set -eux
$BIN/daslang modules/dasClangBind/bind/bind_llvm.das -- --input /usr/lib/llvm-22/include
git diff --exit-code -- modules/dasLLVM/bindings/ \
|| (echo "ERROR: dasLLVM generated bindings are out of date. Run './bin/daslang modules/dasClangBind/bind/bind_llvm.das -- --input <llvm-c-include-path>' locally and commit the result." && exit 1)
- 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