Skip to content

feat(core): integrate Vix UI responses #137

feat(core): integrate Vix UI responses

feat(core): integrate Vix UI responses #137

name: Core Strict CI
on:
push:
branches:
- main
- master
- dev
- release/**
paths:
- ".github/workflows/core-strict-ci.yml"
- "CMakeLists.txt"
- "CMakePresets.json"
- "cmake/**"
- "include/**"
- "src/**"
- "tests/**"
- "benchmarks/**"
- "scripts/**"
- "README.md"
- "CHANGELOG.md"
- "vix.json"
pull_request:
branches:
- main
- master
- dev
- release/**
paths:
- ".github/workflows/core-strict-ci.yml"
- "CMakeLists.txt"
- "CMakePresets.json"
- "cmake/**"
- "include/**"
- "src/**"
- "tests/**"
- "benchmarks/**"
- "scripts/**"
- "README.md"
- "CHANGELOG.md"
- "vix.json"
workflow_dispatch:
permissions:
contents: read
env:
DEPS: >
build-essential
cmake
ninja-build
clang
llvm
lld
g++
cppcheck
clang-tidy
valgrind
pkg-config
git
curl
ca-certificates
libasio-dev
nlohmann-json3-dev
libspdlog-dev
libfmt-dev
libssl-dev
BUILD_JOBS: 2
VIX_GIT_BRANCH: dev
jobs:
sanitized-tests:
name: Sanitized Tests (${{ matrix.compiler }}, tls=${{ matrix.openssl }}, template=${{ matrix.template_mode }})
runs-on: ubuntu-latest
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
compiler: ["clang", "gcc"]
openssl: ["ON", "OFF"]
template_mode: ["AUTO", "OFF"]
env:
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1:strict_string_checks=1:check_initialization_order=1
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
steps:
- name: Checkout core repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends $DEPS
test -f /usr/include/asio.hpp
- name: Fetch sibling dependencies
run: |
set -euxo pipefail
rm -rf ../error ../path ../env ../utils ../async ../io ../json ../template
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/error.git ../error
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/path.git ../path
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/env.git ../env
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/utils.git ../utils
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" --recurse-submodules https://github.com/vixcpp/async.git ../async
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/io.git ../io
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/json.git ../json
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/template.git ../template || true
git -C ../async submodule update --init --recursive --depth 1 || true
- name: Prepare Asio for async
run: |
set -euxo pipefail
mkdir -p ../async/third_party/asio/include
rm -rf ../async/third_party/asio/include
mkdir -p ../async/third_party/asio/include
cp -r /usr/include/asio* ../async/third_party/asio/include/ || true
test -f ../async/third_party/asio/include/asio.hpp
- name: Verify required dependencies
run: |
set -euxo pipefail
test -f ../error/CMakeLists.txt
test -f ../path/CMakeLists.txt
test -f ../env/CMakeLists.txt
test -f ../utils/CMakeLists.txt
test -f ../async/CMakeLists.txt
test -f ../io/CMakeLists.txt
test -f ../json/CMakeLists.txt
test -f ../json/include/vix/json/Simple.hpp
- name: Export dependency include paths
run: |
set -euxo pipefail
EXTRA_PATHS="$GITHUB_WORKSPACE/../error/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../path/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../env/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../utils/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../async/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../io/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../json/include"
if [ -d "$GITHUB_WORKSPACE/../template/include" ]; then
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../template/include"
fi
echo "CPATH=$EXTRA_PATHS${CPATH:+:$CPATH}" >> "$GITHUB_ENV"
echo "CPLUS_INCLUDE_PATH=$EXTRA_PATHS${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}" >> "$GITHUB_ENV"
- name: Select compiler
run: |
set -euxo pipefail
if [ "${{ matrix.compiler }}" = "clang" ]; then
echo "CC=clang" >> "$GITHUB_ENV"
echo "CXX=clang++" >> "$GITHUB_ENV"
else
echo "CC=gcc" >> "$GITHUB_ENV"
echo "CXX=g++" >> "$GITHUB_ENV"
fi
- name: Configure sanitized build
run: |
set -euxo pipefail
cmake -S . -B build-sanitize -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DVIX_CORE_BUILD_TESTS=ON \
-DVIX_CORE_BUILD_BENCHMARKS=OFF \
-DVIX_ENABLE_SANITIZERS=ON \
-DVIX_CORE_WITH_OPENSSL=${{ matrix.openssl }} \
-DVIX_CORE_WITH_TEMPLATE=${{ matrix.template_mode }} \
-DVIX_CORE_WITH_MYSQL=OFF \
-DVIX_BENCH_MODE=OFF
- name: Build sanitized targets
run: |
set -euxo pipefail
cmake --build build-sanitize -j"${BUILD_JOBS}"
- name: Run sanitized tests
run: |
set -euxo pipefail
ctest --test-dir build-sanitize --output-on-failure --timeout 120
runtime-smoke:
name: Runtime Smoke and Shutdown Checks
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout core repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends $DEPS
test -f /usr/include/asio.hpp
- name: Fetch sibling dependencies
run: |
set -euxo pipefail
rm -rf ../error ../path ../env ../utils ../async ../io ../json ../template
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/error.git ../error
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/path.git ../path
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/env.git ../env
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/utils.git ../utils
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" --recurse-submodules https://github.com/vixcpp/async.git ../async
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/io.git ../io
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/json.git ../json
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/template.git ../template || true
git -C ../async submodule update --init --recursive --depth 1 || true
- name: Prepare Asio for async
run: |
set -euxo pipefail
mkdir -p ../async/third_party/asio/include
rm -rf ../async/third_party/asio/include
mkdir -p ../async/third_party/asio/include
cp -r /usr/include/asio* ../async/third_party/asio/include/ || true
test -f ../async/third_party/asio/include/asio.hpp
- name: Verify required dependencies
run: |
set -euxo pipefail
test -f ../error/CMakeLists.txt
test -f ../path/CMakeLists.txt
test -f ../env/CMakeLists.txt
test -f ../utils/CMakeLists.txt
test -f ../async/CMakeLists.txt
test -f ../io/CMakeLists.txt
test -f ../json/CMakeLists.txt
test -f ../json/include/vix/json/Simple.hpp
- name: Export dependency include paths
run: |
set -euxo pipefail
EXTRA_PATHS="$GITHUB_WORKSPACE/../error/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../path/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../env/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../utils/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../async/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../io/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../json/include"
if [ -d "$GITHUB_WORKSPACE/../template/include" ]; then
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../template/include"
fi
echo "CPATH=$EXTRA_PATHS${CPATH:+:$CPATH}" >> "$GITHUB_ENV"
echo "CPLUS_INCLUDE_PATH=$EXTRA_PATHS${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}" >> "$GITHUB_ENV"
- name: Configure runtime build
run: |
set -euxo pipefail
cmake -S . -B build-runtime -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DVIX_CORE_BUILD_TESTS=ON \
-DVIX_CORE_BUILD_BENCHMARKS=OFF \
-DVIX_ENABLE_SANITIZERS=OFF \
-DVIX_CORE_WITH_OPENSSL=OFF \
-DVIX_CORE_WITH_TEMPLATE=OFF \
-DVIX_CORE_WITH_MYSQL=OFF \
-DVIX_BENCH_MODE=OFF
- name: Build runtime artifacts
run: |
set -euxo pipefail
cmake --build build-runtime -j"${BUILD_JOBS}"
- name: Run runtime tests
run: |
set -euxo pipefail
ctest --test-dir build-runtime --output-on-failure --timeout 120
- name: Smoke test non-server executables
shell: bash
run: |
set -euo pipefail
FAIL=0
mapfile -t CANDIDATES < <(
find build-runtime -type f -executable | while read -r exe; do
base="$(basename "$exe")"
if [[ "$exe" =~ /CMakeFiles/ ]]; then
continue
fi
if [[ "$base" =~ (cmake|ctest) ]]; then
continue
fi
echo "$exe"
done | sort -u
)
if [ ${#CANDIDATES[@]} -eq 0 ]; then
echo "::error::No executable candidates found."
exit 1
fi
for exe in "${CANDIDATES[@]}"; do
base="$(basename "$exe")"
if [[ "$base" =~ (server|http|ws|listener|session|lifecycle) ]]; then
echo "Skipping server-like executable: $exe"
continue
fi
echo "==> Smoke run: $exe"
set +e
timeout 5s "$exe" >/tmp/core_smoke.log 2>&1
STATUS=$?
set -e
cat /tmp/core_smoke.log || true
if [ $STATUS -ne 0 ] && [ $STATUS -ne 124 ]; then
echo "::error::Smoke test failed for $exe with status $STATUS"
FAIL=1
fi
done
exit "$FAIL"
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout core repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends $DEPS
test -f /usr/include/asio.hpp
- name: Fetch sibling dependencies
run: |
set -euxo pipefail
rm -rf ../error ../path ../env ../utils ../async ../io ../json ../template
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/error.git ../error
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/path.git ../path
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/env.git ../env
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/utils.git ../utils
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" --recurse-submodules https://github.com/vixcpp/async.git ../async
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/io.git ../io
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/json.git ../json
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/template.git ../template || true
git -C ../async submodule update --init --recursive --depth 1 || true
- name: Prepare Asio for async
run: |
set -euxo pipefail
mkdir -p ../async/third_party/asio/include
rm -rf ../async/third_party/asio/include
mkdir -p ../async/third_party/asio/include
cp -r /usr/include/asio* ../async/third_party/asio/include/ || true
test -f ../async/third_party/asio/include/asio.hpp
- name: Verify required dependencies
run: |
set -euxo pipefail
test -f ../error/CMakeLists.txt
test -f ../path/CMakeLists.txt
test -f ../env/CMakeLists.txt
test -f ../utils/CMakeLists.txt
test -f ../async/CMakeLists.txt
test -f ../io/CMakeLists.txt
test -f ../json/CMakeLists.txt
test -f ../json/include/vix/json/Simple.hpp
- name: Export dependency include paths
run: |
set -euxo pipefail
EXTRA_PATHS="$GITHUB_WORKSPACE/../error/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../path/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../env/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../utils/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../async/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../io/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../json/include"
if [ -d "$GITHUB_WORKSPACE/../template/include" ]; then
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../template/include"
fi
echo "CPATH=$EXTRA_PATHS${CPATH:+:$CPATH}" >> "$GITHUB_ENV"
echo "CPLUS_INCLUDE_PATH=$EXTRA_PATHS${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}" >> "$GITHUB_ENV"
- name: Configure analysis build
run: |
set -euxo pipefail
cmake -S . -B build-analyze -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DVIX_CORE_BUILD_TESTS=ON \
-DVIX_CORE_BUILD_BENCHMARKS=OFF \
-DVIX_ENABLE_SANITIZERS=OFF \
-DVIX_CORE_WITH_OPENSSL=ON \
-DVIX_CORE_WITH_TEMPLATE=AUTO \
-DVIX_CORE_WITH_MYSQL=OFF \
-DVIX_BENCH_MODE=OFF
- name: Build analysis target
run: |
set -euxo pipefail
cmake --build build-analyze -j"${BUILD_JOBS}"
- name: Run clang-tidy
run: |
set -euo pipefail
mapfile -d '' FILES < <(find src tests -name '*.cpp' -print0)
if [ ${#FILES[@]} -eq 0 ]; then
echo "::error::No source files found for clang-tidy."
exit 1
fi
clang-tidy -p build-analyze "${FILES[@]}"
- name: Run cppcheck on library code
run: |
set -euxo pipefail
cppcheck \
--enable=warning,performance,portability \
--std=c++20 \
--inconclusive \
--error-exitcode=2 \
--suppress=missingIncludeSystem \
--inline-suppr \
include/ src/
- name: Run cppcheck style report
run: |
set -euxo pipefail
cppcheck \
--enable=style \
--std=c++20 \
--suppress=missingIncludeSystem \
--inline-suppr \
include/ src/ tests/ || true
- name: Run cppcheck on tests
run: |
set -euxo pipefail
cppcheck \
--enable=warning,portability \
--std=c++20 \
--inconclusive \
--error-exitcode=2 \
--suppress=missingIncludeSystem \
--inline-suppr \
tests/
- name: Run cppcheck performance report on tests
run: |
set -euxo pipefail
cppcheck \
--enable=performance \
--std=c++20 \
--inconclusive \
--suppress=missingIncludeSystem \
--inline-suppr \
tests/ || true
valgrind:
name: Valgrind Memory Checks
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Checkout core repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends $DEPS
test -f /usr/include/asio.hpp
- name: Fetch sibling dependencies
run: |
set -euxo pipefail
rm -rf ../error ../path ../env ../utils ../async ../io ../json ../template
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/error.git ../error
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/path.git ../path
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/env.git ../env
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/utils.git ../utils
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" --recurse-submodules https://github.com/vixcpp/async.git ../async
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/io.git ../io
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/json.git ../json
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/template.git ../template || true
git -C ../async submodule update --init --recursive --depth 1 || true
- name: Prepare Asio for async
run: |
set -euxo pipefail
mkdir -p ../async/third_party/asio/include
rm -rf ../async/third_party/asio/include
mkdir -p ../async/third_party/asio/include
cp -r /usr/include/asio* ../async/third_party/asio/include/ || true
test -f ../async/third_party/asio/include/asio.hpp
- name: Verify required dependencies
run: |
set -euxo pipefail
test -f ../error/CMakeLists.txt
test -f ../path/CMakeLists.txt
test -f ../env/CMakeLists.txt
test -f ../utils/CMakeLists.txt
test -f ../async/CMakeLists.txt
test -f ../io/CMakeLists.txt
test -f ../json/CMakeLists.txt
test -f ../json/include/vix/json/Simple.hpp
- name: Export dependency include paths
run: |
set -euxo pipefail
EXTRA_PATHS="$GITHUB_WORKSPACE/../error/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../path/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../env/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../utils/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../async/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../io/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../json/include"
if [ -d "$GITHUB_WORKSPACE/../template/include" ]; then
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../template/include"
fi
echo "CPATH=$EXTRA_PATHS${CPATH:+:$CPATH}" >> "$GITHUB_ENV"
echo "CPLUS_INCLUDE_PATH=$EXTRA_PATHS${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}" >> "$GITHUB_ENV"
- name: Configure valgrind build
run: |
set -euxo pipefail
cmake -S . -B build-valgrind -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DVIX_CORE_BUILD_TESTS=ON \
-DVIX_CORE_BUILD_BENCHMARKS=OFF \
-DVIX_ENABLE_SANITIZERS=OFF \
-DVIX_CORE_WITH_OPENSSL=OFF \
-DVIX_CORE_WITH_TEMPLATE=OFF \
-DVIX_CORE_WITH_MYSQL=OFF \
-DVIX_BENCH_MODE=OFF
- name: Build valgrind targets
run: |
set -euxo pipefail
cmake --build build-valgrind -j"${BUILD_JOBS}"
- name: List tests before valgrind
run: |
set -euxo pipefail
ctest --test-dir build-valgrind -N
- name: Run valgrind on test executables
shell: bash
run: |
set -euo pipefail
FAIL=0
mapfile -t TEST_BINS < <(
find build-valgrind/tests -type f -executable 2>/dev/null \
| grep -Ev '(/runtime_bench$|_bench$)' \
| sort
)
if [ ${#TEST_BINS[@]} -eq 0 ]; then
echo "::error::No test executables found for valgrind."
exit 1
fi
for exe in "${TEST_BINS[@]}"; do
echo "==> Valgrind: $exe"
LIMIT="90s"
case "$(basename "$exe")" in
runtime_worker_test)
LIMIT="300s"
;;
app_lifecycle_test)
LIMIT="240s"
;;
esac
set +e
timeout "$LIMIT" valgrind \
--leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--errors-for-leak-kinds=definite,indirect,possible \
--error-exitcode=99 \
"$exe"
STATUS=$?
set -e
if [ $STATUS -ne 0 ]; then
echo "::error::Valgrind failed for $exe with status $STATUS"
FAIL=1
fi
done
exit "$FAIL"
release-and-bench:
name: Release and Benchmark Coverage
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout core repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends $DEPS
test -f /usr/include/asio.hpp
- name: Fetch sibling dependencies
run: |
set -euxo pipefail
rm -rf ../error ../path ../env ../utils ../async ../io ../json ../template
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/error.git ../error
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/path.git ../path
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/env.git ../env
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/utils.git ../utils
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" --recurse-submodules https://github.com/vixcpp/async.git ../async
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/io.git ../io
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/json.git ../json
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/template.git ../template || true
git -C ../async submodule update --init --recursive --depth 1 || true
- name: Prepare Asio for async
run: |
set -euxo pipefail
mkdir -p ../async/third_party/asio/include
rm -rf ../async/third_party/asio/include
mkdir -p ../async/third_party/asio/include
cp -r /usr/include/asio* ../async/third_party/asio/include/ || true
test -f ../async/third_party/asio/include/asio.hpp
- name: Verify required dependencies
run: |
set -euxo pipefail
test -f ../error/CMakeLists.txt
test -f ../path/CMakeLists.txt
test -f ../env/CMakeLists.txt
test -f ../utils/CMakeLists.txt
test -f ../async/CMakeLists.txt
test -f ../io/CMakeLists.txt
test -f ../json/CMakeLists.txt
test -f ../json/include/vix/json/Simple.hpp
- name: Export dependency include paths
run: |
set -euxo pipefail
EXTRA_PATHS="$GITHUB_WORKSPACE/../error/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../path/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../env/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../utils/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../async/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../io/include"
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../json/include"
if [ -d "$GITHUB_WORKSPACE/../template/include" ]; then
EXTRA_PATHS="$EXTRA_PATHS:$GITHUB_WORKSPACE/../template/include"
fi
echo "CPATH=$EXTRA_PATHS${CPATH:+:$CPATH}" >> "$GITHUB_ENV"
echo "CPLUS_INCLUDE_PATH=$EXTRA_PATHS${CPLUS_INCLUDE_PATH:+:$CPLUS_INCLUDE_PATH}" >> "$GITHUB_ENV"
- name: Configure release tests
run: |
set -euxo pipefail
cmake -S . -B build-release-tests -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DVIX_CORE_BUILD_TESTS=ON \
-DVIX_CORE_BUILD_BENCHMARKS=OFF \
-DVIX_ENABLE_SANITIZERS=OFF \
-DVIX_CORE_WITH_OPENSSL=ON \
-DVIX_CORE_WITH_TEMPLATE=AUTO \
-DVIX_CORE_WITH_MYSQL=OFF \
-DVIX_BENCH_MODE=OFF
- name: Build release tests
run: |
set -euxo pipefail
cmake --build build-release-tests -j"${BUILD_JOBS}"
- name: Run release tests
run: |
set -euxo pipefail
ctest --test-dir build-release-tests --output-on-failure --timeout 120
- name: Configure benchmark build
run: |
set -euxo pipefail
cmake -S . -B build-bench -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DVIX_CORE_BUILD_TESTS=ON \
-DVIX_CORE_BUILD_BENCHMARKS=ON \
-DVIX_ENABLE_SANITIZERS=OFF \
-DVIX_CORE_WITH_OPENSSL=OFF \
-DVIX_CORE_WITH_TEMPLATE=OFF \
-DVIX_CORE_WITH_MYSQL=OFF \
-DVIX_BENCH_MODE=ON
- name: Build benchmarks
run: |
set -euxo pipefail
cmake --build build-bench -j"${BUILD_JOBS}"
- name: Verify benchmark executables
run: |
set -euxo pipefail
find build-bench -type f -executable | sort
COUNT="$(find build-bench -type f -executable | grep -c 'bench' || true)"
if [ "$COUNT" -eq 0 ]; then
echo "::error::No benchmark executable found."
exit 1
fi
package-export:
name: Package Export Check
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout core repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends $DEPS
test -f /usr/include/asio.hpp
- name: Fetch sibling dependencies
run: |
set -euxo pipefail
rm -rf ../error ../path ../env ../utils ../async ../io ../json ../template
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/error.git ../error
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/path.git ../path
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/env.git ../env
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/utils.git ../utils
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" --recurse-submodules https://github.com/vixcpp/async.git ../async
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/io.git ../io
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/json.git ../json
git clone --depth 1 --branch "${VIX_GIT_BRANCH}" https://github.com/vixcpp/template.git ../template || true
git -C ../async submodule update --init --recursive --depth 1 || true
- name: Prepare Asio for async
run: |
set -euxo pipefail
mkdir -p ../async/third_party/asio/include
rm -rf ../async/third_party/asio/include
mkdir -p ../async/third_party/asio/include
cp -r /usr/include/asio* ../async/third_party/asio/include/ || true
test -f ../async/third_party/asio/include/asio.hpp
- name: Verify required dependencies
run: |
set -euxo pipefail
test -f ../error/CMakeLists.txt
test -f ../path/CMakeLists.txt
test -f ../env/CMakeLists.txt
test -f ../utils/CMakeLists.txt
test -f ../async/CMakeLists.txt
test -f ../io/CMakeLists.txt
test -f ../json/CMakeLists.txt
test -f ../json/include/vix/json/Simple.hpp
- name: Configure installable build
run: |
set -euxo pipefail
cmake -S . -B build-install -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DVIX_CORE_BUILD_TESTS=OFF \
-DVIX_CORE_BUILD_BENCHMARKS=OFF \
-DVIX_ENABLE_SANITIZERS=OFF \
-DVIX_CORE_WITH_OPENSSL=ON \
-DVIX_CORE_WITH_TEMPLATE=AUTO \
-DVIX_CORE_WITH_MYSQL=OFF \
-DVIX_BENCH_MODE=OFF \
-DCMAKE_INSTALL_PREFIX="${PWD}/.ci-install"
- name: Build installable package
run: |
set -euxo pipefail
cmake --build build-install -j"${BUILD_JOBS}"
- name: Install package
run: |
set -euxo pipefail
cmake --install build-install
- name: Verify install tree
run: |
set -euxo pipefail
find .ci-install -maxdepth 8 -type f | sort
test -d .ci-install/include/vix
test -f .ci-install/lib/cmake/vix_core/vix_coreConfig.cmake
test -f .ci-install/lib/cmake/vix_core/vix_coreConfigVersion.cmake
test -f .ci-install/lib/cmake/vix_core/vix_coreTargets.cmake
summary:
name: Core Strict CI Summary
needs:
- sanitized-tests
- runtime-smoke
- static-analysis
- valgrind
- release-and-bench
- package-export
runs-on: ubuntu-latest
steps:
- name: Print summary
run: |
echo "Core strict CI completed successfully."
echo "- Sanitized builds and tests"
echo "- Runtime smoke and shutdown checks"
echo "- Static analysis"
echo "- Valgrind memory checks"
echo "- Release tests"
echo "- Benchmark build coverage"
echo "- Package export check"