ci: platform x variant matrix with Windows lanes and packages
VoidBuildSystem CI / 1 · Requirements (push) Successful in 4s
VoidBuildSystem CI / 2b · Windows native (debug) (push) Failing after 16s
VoidBuildSystem CI / 2b · Windows native (relwithdebinfo) (push) Failing after 8s
VoidBuildSystem CI / 2 · Linux build (debug) (push) Successful in 2m40s
VoidBuildSystem CI / 2 · Linux build (asan) (push) Successful in 5m0s
VoidBuildSystem CI / 2 · Linux build (ubsan) (push) Successful in 5m10s
VoidBuildSystem CI / 2 · Linux build (relwithdebinfo) (push) Successful in 4m46s
VoidBuildSystem CI / 3 · Linux test (asan) (push) Successful in 56s
VoidBuildSystem CI / 3 · Linux test (ubsan) (push) Successful in 1m56s
VoidBuildSystem CI / 3 · Linux test (debug) (push) Failing after 6m43s
VoidBuildSystem CI / 3b · Windows Wine test (debug) (push) Failing after 2m37s
VoidBuildSystem CI / 3b · Windows Wine test (relwithdebinfo) (push) Failing after 2m5s
VoidBuildSystem CI / 3 · Linux test (relwithdebinfo) (push) Failing after 5m35s
VoidBuildSystem CI / 4 · Linux package (asan) (push) Skipped
VoidBuildSystem CI / 4 · Linux package (debug) (push) Skipped
VoidBuildSystem CI / 4 · Linux package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4 · Linux package (ubsan) (push) Skipped
VoidBuildSystem CI / 5 · Release (push) Skipped

Split the pipeline into Linux native (Debug, RelWithDebInfo, ASan,
UBSan), Windows Wine (Debug, RelWithDebInfo) and Windows native MSYS2
UCRT64 lanes, each with its own test and package jobs whose packages
are downloadable from the run. The release publishes only the
RelWithDebInfo packages of Linux native and Windows native.

Native Windows stays non-blocking until the Track C3 port lands: VBS's
platform backends are Linux-only and VoidLibrary does not qualify
Archive/Configuration/Crypto/System for Windows yet (Void/Library
issue #65).
This commit is contained in:
faumaray committed 2026-12-05 15:20:56 +03:00
1 parent c4d0783366
commit 76b15e79c4
2 files changed
+212 -93

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Native Windows build, test and package for one variant.
#
# Runs inside MSYS2 UCRT64 (invoked from the ci.yml windows-native job):
# windows-native.sh <variant> <build_type>
#
# Track C3 caveat: the VBS platform backends are Linux-only today and
# VoidLibrary does not qualify Archive/Configuration/Crypto/System for Windows
# yet (Void/Library issue #65), so this lane fails until that port lands.
set -euo pipefail
variant="${1:?variant}"
build_type="${2:?build type}"
root="$(cd "$(dirname "$0")/../.." && pwd)"
cd "${root}"
build="build/windows-${variant}"
out="dist-windows-${variant}"
cmake -S . -B "${build}" -G Ninja \
-DCMAKE_BUILD_TYPE="${build_type}" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cmake --build "${build}" --parallel 4
ctest --test-dir "${build}" --output-on-failure
label="${VBS_RELEASE_TAG:-}"
if [ -z "${label}" ]; then
case "${GITHUB_REF_NAME:-}" in
v*) label="${GITHUB_REF_NAME}" ;;
*) label="dev-$(printf '%s' "${GITHUB_SHA:-local}" | cut -c1-7)" ;;
esac
fi
stage="$(mktemp -d)"
mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" "${out}"
cp "${build}"/bin/*.exe "${stage}/bin/" 2>/dev/null || true
cp -r include/Void "${stage}/include/"
find "${build}" -maxdepth 1 -name 'libVoidBuild_Sdk.a' -exec cp {} "${stage}/lib/" \;
cp README.md LICENSE "${stage}/"
tar -czf "${out}/vbs-${label}-windows-x86_64-${variant}.tar.gz" -C "${stage}" .
ls -l "${out}/"
+169 -93
View File
@@ -1,21 +1,28 @@
# VoidBuildSystem CI (Gitea Actions). # VoidBuildSystem CI (Gitea Actions).
# #
# Multi-stage pipeline with one job per stage step: # Platform x variant pipeline:
# #
# 1. requirements verify the GCC 16 toolchain and install development headers # 1. requirements verify the GCC 16 toolchain and install development headers
# 2. build one job per configuration (Debug, RelWithDebInfo, ASan, UBSan) # 2. build Linux native (Debug, RelWithDebInfo, ASan, UBSan)
# 3. test one job per build configuration, consuming its build artifact # Windows Wine (Debug, RelWithDebInfo) - cross-built targets
# 4. package bundle the RelWithDebInfo binaries, the SDK and the source archive # Windows native MSYS2 UCRT64 (Debug, RelWithDebInfo)
# 5. release optional: publish the packages as a Gitea release (v* tag or # 3. test one job per build configuration
# a manual dispatch with publish=true) # 4. package one downloadable package per configuration (run artifacts)
# 5. release publishes ONLY the RelWithDebInfo packages of Linux native
# and Windows native (v* tag or a manual publish dispatch)
# #
# Runner: `echoion-release-serial` - the GCC 16 builder container (Debian-based, # Runner: `echoion-release-serial` (GCC 16 builder container, Debian-based) and
# with CMake, Ninja, Node and pkg-config). GCC 16 is required for C++26. # `windows-x64` (native Windows runner with MSYS2 at C:\msys64).
# #
# Jobs are isolated, so build outputs travel between stages as artifacts. The # Jobs are isolated, so build outputs travel between stages as artifacts. The
# artifact paths are uploaded relative to the build directory and restored under # artifact paths are uploaded relative to the build directory and restored under
# the same workspace-relative location, keeping the absolute paths recorded in # the same workspace-relative location, keeping the absolute paths recorded in
# the CTest files valid. # the CTest files valid.
#
# Native Windows is gated on the Track C3 port: VBS's platform backends are
# Linux-only today and VoidLibrary does not qualify Archive/Configuration/
# Crypto/System for Windows yet (Void/Library issue #65). The windows-native
# lane is non-blocking until that port lands.
name: VoidBuildSystem CI name: VoidBuildSystem CI
on: on:
@@ -84,27 +91,27 @@ jobs:
echo "all development packages are already installed" echo "all development packages are already installed"
fi fi
build: linux-build:
name: "2 · Build (${{ matrix.name }})" name: "2 · Linux build (${{ matrix.variant }})"
needs: requirements needs: requirements
runs-on: echoion-release-serial runs-on: echoion-release-serial
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- name: debug - variant: debug
build_type: Debug build_type: Debug
cxx_flags: "" cxx_flags: ""
linker_flags: "" linker_flags: ""
- name: relwithdebinfo - variant: relwithdebinfo
build_type: RelWithDebInfo build_type: RelWithDebInfo
cxx_flags: "" cxx_flags: ""
linker_flags: "" linker_flags: ""
- name: asan - variant: asan
build_type: Debug build_type: Debug
cxx_flags: "-fsanitize=address -fno-omit-frame-pointer" cxx_flags: "-fsanitize=address -fno-omit-frame-pointer"
linker_flags: "-fsanitize=address" linker_flags: "-fsanitize=address"
- name: ubsan - variant: ubsan
build_type: Debug build_type: Debug
cxx_flags: "-fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer" cxx_flags: "-fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer"
linker_flags: "-fsanitize=undefined" linker_flags: "-fsanitize=undefined"
@@ -112,43 +119,43 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Configure - name: Configure
run: | run: |
cmake -S . -B "build/${{ matrix.name }}" -G Ninja \ cmake -S . -B "build/linux-${{ matrix.variant }}" -G Ninja \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_COMPILER=g++ \ -DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \ -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DCMAKE_EXE_LINKER_FLAGS="${{ matrix.linker_flags }}" \ -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.linker_flags }}" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build - name: Build
run: cmake --build "build/${{ matrix.name }}" --parallel 4 run: cmake --build "build/linux-${{ matrix.variant }}" --parallel 4
- name: Upload the build - name: Upload the build
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: vbs-build-${{ matrix.name }} name: vbs-linux-build-${{ matrix.variant }}
path: | path: |
build/${{ matrix.name }}/bin/ build/linux-${{ matrix.variant }}/bin/
build/${{ matrix.name }}/CTestTestfile.cmake build/linux-${{ matrix.variant }}/CTestTestfile.cmake
build/${{ matrix.name }}/tests/CTestTestfile.cmake build/linux-${{ matrix.variant }}/tests/CTestTestfile.cmake
build/${{ matrix.name }}/_deps/voidlibrary-src/ build/linux-${{ matrix.variant }}/_deps/voidlibrary-src/
!build/${{ matrix.name }}/_deps/voidlibrary-src/.git/ !build/linux-${{ matrix.variant }}/_deps/voidlibrary-src/.git/
build/${{ matrix.name }}/libVoidBuild_Sdk.a build/linux-${{ matrix.variant }}/libVoidBuild_Sdk.a
build/${{ matrix.name }}/compile_commands.json build/linux-${{ matrix.variant }}/compile_commands.json
retention-days: 7 retention-days: 7
test: linux-test:
name: "3 · Test (${{ matrix.name }})" name: "3 · Linux test (${{ matrix.variant }})"
needs: build needs: linux-build
runs-on: echoion-release-serial runs-on: echoion-release-serial
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- name: debug - variant: debug
test_regex: "" test_regex: ""
- name: relwithdebinfo - variant: relwithdebinfo
test_regex: "" test_regex: ""
- name: asan - variant: asan
test_regex: "vbs_sdk_tests|vbs_core_tests" test_regex: "vbs_sdk_tests|vbs_core_tests"
- name: ubsan - variant: ubsan
test_regex: "vbs_sdk_tests|vbs_core_tests" test_regex: "vbs_sdk_tests|vbs_core_tests"
env: env:
ASAN_OPTIONS: detect_leaks=1 ASAN_OPTIONS: detect_leaks=1
@@ -158,46 +165,105 @@ jobs:
- name: Download the build - name: Download the build
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: vbs-build-${{ matrix.name }} name: vbs-linux-build-${{ matrix.variant }}
path: build/${{ matrix.name }} path: build/linux-${{ matrix.variant }}
- name: Make the restored binaries executable - name: Make the restored binaries executable
run: chmod +x "build/${{ matrix.name }}/bin/"* run: chmod +x "build/linux-${{ matrix.variant }}/bin/"*
- name: Run CTest - name: Run CTest
run: | run: |
set -o pipefail set -o pipefail
if [ -n "${{ matrix.test_regex }}" ]; then if [ -n "${{ matrix.test_regex }}" ]; then
ctest --test-dir "build/${{ matrix.name }}" --output-on-failure \ ctest --test-dir "build/linux-${{ matrix.variant }}" --output-on-failure \
--no-tests=error -R "${{ matrix.test_regex }}" 2>&1 | tee "ctest-${{ matrix.name }}.log" --no-tests=error -R "${{ matrix.test_regex }}" 2>&1 | tee "ctest-linux-${{ matrix.variant }}.log"
else else
ctest --test-dir "build/${{ matrix.name }}" --output-on-failure \ ctest --test-dir "build/linux-${{ matrix.variant }}" --output-on-failure \
--no-tests=error 2>&1 | tee "ctest-${{ matrix.name }}.log" --no-tests=error 2>&1 | tee "ctest-linux-${{ matrix.variant }}.log"
fi fi
- name: Benchmark smoke run - name: Benchmark smoke run
if: matrix.name == 'debug' if: matrix.variant == 'debug'
run: build/debug/bin/vbs_benchmarks --files 15 run: build/linux-debug/bin/vbs_benchmarks --files 15
- name: Upload the test log - name: Upload the test log
if: always() if: always()
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: vbs-test-${{ matrix.name }} name: vbs-linux-test-${{ matrix.variant }}
path: ctest-${{ matrix.name }}.log path: ctest-linux-${{ matrix.variant }}.log
retention-days: 14 retention-days: 14
windows: linux-package:
name: "3b · Windows (MinGW-w64 + Wine)" name: "4 · Linux package (${{ matrix.variant }})"
needs: build needs: linux-test
runs-on: echoion-release-serial runs-on: echoion-release-serial
strategy:
fail-fast: false
matrix:
include:
- variant: debug
- variant: relwithdebinfo
- variant: asan
- variant: ubsan
steps:
- uses: actions/checkout@v4
- name: Download the build
uses: actions/download-artifact@v3
with:
name: vbs-linux-build-${{ matrix.variant }}
path: build/linux-${{ matrix.variant }}
- name: Make the restored binaries executable
run: chmod +x "build/linux-${{ matrix.variant }}/bin/"*
- name: Package the binaries, the SDK and the headers
run: |
set -eu
label="${{ github.event.inputs.tag }}"
if [ -z "${label}" ]; then
case "${GITHUB_REF_NAME}" in
v*) label="${GITHUB_REF_NAME}" ;;
*) label="dev-$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)" ;;
esac
fi
stage="$(mktemp -d)"
out="dist-linux-${{ matrix.variant }}"
mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" "${out}"
cp "build/linux-${{ matrix.variant }}/bin/vbs" \
"build/linux-${{ matrix.variant }}/bin/vbs-registry" "${stage}/bin/"
cp -r include/Void "${stage}/include/"
cp "build/linux-${{ matrix.variant }}/libVoidBuild_Sdk.a" "${stage}/lib/"
cp README.md LICENSE "${stage}/"
tar --sort=name --mtime='@0' --owner=0 --group=0 --numeric-owner \
-czf "${out}/vbs-${label}-linux-x86_64-${{ matrix.variant }}.tar.gz" -C "${stage}" .
if [ "${{ matrix.variant }}" = "relwithdebinfo" ]; then
"build/linux-${{ matrix.variant }}/bin/vbs" pack --project . \
--output "${out}/vbs-${label}-source.tar"
fi
ls -l "${out}/"
- name: Upload the package
uses: actions/upload-artifact@v3
with:
name: vbs-linux-package-${{ matrix.variant }}
path: dist-linux-${{ matrix.variant }}/
retention-days: 30
windows-wine:
name: "3b · Windows Wine test (${{ matrix.variant }})"
needs: linux-build
runs-on: echoion-release-serial
strategy:
fail-fast: false
matrix:
include:
- variant: debug
- variant: relwithdebinfo
env: env:
WINEDEBUG: "-all" WINEDEBUG: "-all"
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Download the debug build - name: Download the Linux build
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: vbs-build-debug name: vbs-linux-build-${{ matrix.variant }}
path: build/debug path: build/linux-${{ matrix.variant }}
- name: Make the restored binaries executable - name: Make the restored binaries executable
run: chmod +x build/debug/bin/* run: chmod +x "build/linux-${{ matrix.variant }}/bin/"*
- name: Install the MinGW-w64 cross toolchain and Wine - name: Install the MinGW-w64 cross toolchain and Wine
run: | run: |
sudo="" sudo=""
@@ -226,70 +292,77 @@ jobs:
- name: Cross-build a Windows target and run it under Wine - name: Cross-build a Windows target and run it under Wine
run: | run: |
set -o pipefail set -o pipefail
build/debug/bin/vbs_v1_tests --no-color \ "build/linux-${{ matrix.variant }}/bin/vbs_v1_tests" --no-color \
--filter track_c_windows_target_cross_build_and_wine_test \ --filter track_c_windows_target_cross_build_and_wine_test \
2>&1 | tee ctest-windows.log 2>&1 | tee "ctest-wine-${{ matrix.variant }}.log"
- name: Upload the Windows log - name: Upload the Wine log
if: always() if: always()
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: vbs-test-windows name: vbs-wine-test-${{ matrix.variant }}
path: ctest-windows.log path: ctest-wine-${{ matrix.variant }}.log
retention-days: 14 retention-days: 14
package: windows-native:
name: "4 · Package" name: "2b · Windows native (${{ matrix.variant }})"
needs: test needs: requirements
runs-on: echoion-release-serial runs-on: windows-x64
# Track C3 port in progress: the VBS platform backends are Linux-only and
# VoidLibrary does not qualify Archive/Configuration/Crypto/System for
# Windows yet (Void/Library issue #65). Non-blocking until that lands.
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- variant: debug
build_type: Debug
- variant: relwithdebinfo
build_type: RelWithDebInfo
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Download the RelWithDebInfo build - name: Configure, build, test and package with MSYS2 UCRT64
uses: actions/download-artifact@v3 shell: cmd
with: env:
name: vbs-build-relwithdebinfo VBS_MSYS2_ROOT: ${{ vars.VBS_MSYS2_ROOT || 'C:\msys64' }}
path: build/relwithdebinfo VBS_RELEASE_TAG: ${{ github.event.inputs.tag }}
- name: Make the restored binaries executable
run: chmod +x build/relwithdebinfo/bin/*
- name: Package the binaries, the SDK and the source
run: | run: |
set -eu @echo off
label="${{ github.event.inputs.tag }}" setlocal EnableExtensions
if [ -z "${label}" ]; then if not exist "%VBS_MSYS2_ROOT%\usr\bin\bash.exe" (
case "${GITHUB_REF_NAME}" in echo Windows CI: MSYS2 bash.exe was not found under VBS_MSYS2_ROOT. 1>&2
v*) label="${GITHUB_REF_NAME}" ;; exit /b 1
*) label="dev-$(printf '%s' "${GITHUB_SHA}" | cut -c1-7)" ;; )
esac set "MSYSTEM=UCRT64"
fi set "CHERE_INVOKING=1"
stage="$(mktemp -d)" set "MSYS2_PATH_TYPE=strict"
mkdir -p "${stage}/bin" "${stage}/include" "${stage}/lib" dist "%VBS_MSYS2_ROOT%\usr\bin\bash.exe" --login -c "tr -d '\r' < .gitea/scripts/windows-native.sh | bash -s -- ${{ matrix.variant }} ${{ matrix.build_type }}"
cp build/relwithdebinfo/bin/vbs build/relwithdebinfo/bin/vbs-registry "${stage}/bin/" - name: Upload the Windows package
cp -r include/Void "${stage}/include/" if: always()
cp build/relwithdebinfo/libVoidBuild_Sdk.a "${stage}/lib/"
cp README.md LICENSE "${stage}/"
tar --sort=name --mtime='@0' --owner=0 --group=0 --numeric-owner \
-czf "dist/vbs-${label}-linux-x86_64.tar.gz" -C "${stage}" .
build/relwithdebinfo/bin/vbs pack --project . --output "dist/vbs-${label}-source.tar"
rm -f dist/SHA256SUMS
(cd dist && sha256sum ./* > SHA256SUMS)
ls -l dist/
- name: Upload the packages
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: vbs-packages name: vbs-windows-package-${{ matrix.variant }}
path: dist/ path: dist-windows-${{ matrix.variant }}/
if-no-files-found: ignore
retention-days: 30 retention-days: 30
release: release:
name: "5 · Release" name: "5 · Release"
needs: package needs: linux-package
if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish == 'true' if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish == 'true'
runs-on: echoion-release-serial runs-on: echoion-release-serial
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Download the packages - name: Download the RelWithDebInfo Linux package
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: vbs-packages name: vbs-linux-package-relwithdebinfo
path: dist
- name: Download the RelWithDebInfo Windows package (when available)
continue-on-error: true
uses: actions/download-artifact@v3
with:
name: vbs-windows-package-relwithdebinfo
path: dist path: dist
- name: Verify the tag matches the project version - name: Verify the tag matches the project version
run: | run: |
@@ -316,6 +389,9 @@ jobs:
v*) ;; v*) ;;
*) echo "not a release tag (${tag}); skipping the release upload" ; exit 0 ;; *) echo "not a release tag (${tag}); skipping the release upload" ; exit 0 ;;
esac esac
rm -f dist/SHA256SUMS
(cd dist && sha256sum ./* > SHA256SUMS)
ls -l dist/
api="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" api="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
body="$(printf 'Release %s\n\nBuilt from %s with the full CTest suite green.\nSee SHA256SUMS for artifact digests.' "${tag}" "${GITHUB_SHA}")" body="$(printf 'Release %s\n\nBuilt from %s with the full CTest suite green.\nSee SHA256SUMS for artifact digests.' "${tag}" "${GITHUB_SHA}")"
payload="$(printf '{"tag_name":"%s","name":"%s","body":"%s","draft":false,"prerelease":false}' \ payload="$(printf '{"tag_name":"%s","name":"%s","body":"%s","draft":false,"prerelease":false}' \