# VoidBuildSystem CI (Gitea Actions). # # Assumes a self-hosted runner on a machine with the documented dev toolchain: # dev cpp-gcc -c (GCC 16.2, CMake, Ninja) # dev cpp -c (Clang 23 + libFuzzer) # Optional jobs add Nix packages with `dev ... -p ` (glslang, wine64, MinGW). name: VoidBuildSystem CI on: push: branches: [main] pull_request: jobs: build-and-test-gcc16: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Check the dev toolchain run: | command -v dev || { echo "the 'dev' toolchain wrapper is required on this runner" >&2; exit 1; } dev cpp-gcc -c g++ --version | head -1 - name: Configure (Debug, Ninja, GCC 16 C++26) run: | dev cpp-gcc -c cmake -S . -B build/ci-gcc -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - name: Build run: dev cpp-gcc -c cmake --build build/ci-gcc --parallel 4 - name: Run CTest suites run: | set -o pipefail dev cpp-gcc -c ctest --test-dir build/ci-gcc --output-on-failure 2>&1 | tee ctest.log - name: Check formatting on owned C++ files run: | dev cpp-gcc -c clang-format --dry-run --Werror \ build.cpp build.profiles.cpp build-support/*.hpp build-support/*.cpp \ sdk/*.cpp include/Void/Build.hpp include/Void/Build/*/*.hpp \ src/*.cpp src/*/*.cpp src/*/*/*.cpp \ recipes/*/*.hpp recipes/*/*.cpp \ registry/include/Void/Build/Registry/*.hpp registry/service/*.cpp registry/cli/*.cpp \ benchmarks/*.cpp tests/*.cpp - name: Benchmark smoke run run: dev cpp-gcc -c build/ci-gcc/bin/vbs_benchmarks 15 - name: Upload build artifacts if: always() uses: actions/upload-artifact@v3 with: name: vbs-debug-linux-x86_64 path: | build/ci-gcc/bin/vbs build/ci-gcc/bin/vbs-registry build/ci-gcc/bin/vbs_v1_tests build/ci-gcc/compile_commands.json ctest.log retention-days: 14 signing-openssl-gcc16: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Configure (Debug, Ninja, GCC 16 C++26, OpenSSL) run: | dev cpp-gcc -p openssl -c cmake -S . -B build/ci-openssl -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - name: Build vbs_v1_tests run: dev cpp-gcc -p openssl -c cmake --build build/ci-openssl --target vbs_v1_tests --parallel 4 - name: Run Signing suite with the OpenSSL backend run: | output=$(dev cpp-gcc -p openssl -c build/ci-openssl/bin/vbs_v1_tests --suite Signing --no-color) printf '%s\n' "$output" if printf '%s\n' "$output" | grep -q 'SKIP'; then echo "Signing checks were skipped: the OpenSSL backend was not enabled" >&2 exit 1 fi sanitizers-gcc16: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Configure with ASan + UBSan run: | dev cpp-gcc -c cmake -S . -B build/ci-asan -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \ -DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer" \ -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined" - name: Build run: dev cpp-gcc -c cmake --build build/ci-asan --parallel 4 - name: Run sanitizer-safe suites env: ASAN_OPTIONS: detect_leaks=1 UBSAN_OPTIONS: print_stacktrace=1 run: | dev cpp-gcc -c ctest --test-dir build/ci-asan -R "vbs_sdk_tests|vbs_core_tests" --output-on-failure - name: Upload sanitizer logs if: always() uses: actions/upload-artifact@v3 with: name: vbs-asan-ubsan-logs path: build/ci-asan/Testing/**/LastTest.log retention-days: 14 wine-windows-gcc16: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Configure (Debug, Ninja, GCC 16 C++26) run: | dev cpp-gcc -c cmake -S . -B build/ci-wine -G Ninja \ -DCMAKE_BUILD_TYPE=Debug - name: Build vbs and vbs_v1_tests run: dev cpp-gcc -c cmake --build build/ci-wine --target vbs vbs_v1_tests --parallel 4 - name: Run the Windows target cross-build test under Wine run: | dev cpp-gcc -p wine64 -p pkgsCross.mingwW64.stdenv.cc -c \ build/ci-wine/bin/vbs_v1_tests \ --filter track_c_windows_target_cross_build_and_wine_test --no-color fuzz-clang: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Configure (Debug, Ninja) run: | dev cpp-gcc -c cmake -S . -B build/ci-fuzz -G Ninja \ -DCMAKE_BUILD_TYPE=Debug - name: Build vbs (for the VoidLibrary headers) run: dev cpp-gcc -c cmake --build build/ci-fuzz --target vbs --parallel 4 - name: Fuzz the header-only parsers for 60 seconds env: VOID_INCLUDE_DIR: ${{ github.workspace }}/build/ci-fuzz/_deps/voidlibrary-src/include FUZZ_OUT: ${{ github.workspace }}/build/fuzz run: dev cpp -c bash fuzz/run.sh 60 - name: Upload the fuzz corpus if: always() uses: actions/upload-artifact@v3 with: name: vbs-fuzz-corpus path: build/fuzz/corpus retention-days: 14