Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/scripts/configure-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ if [ -n "${RELEASE_ID:-}" ]; then
)
fi

if command -v go >/dev/null 2>&1; then
cmake_args+=(
"-DREQPACK_GO_EXECUTABLE=$(command -v go)"
)
fi

if [ "$target_family" = "linux" ]; then
cmake_args+=(
-DBUILD_SHARED_LIBS=OFF
Expand All @@ -36,6 +42,43 @@ if [ "$target_family" = "macos" ]; then
)
fi

if [ "$target_family" = "windows" ]; then
: "${MSYSTEM_PREFIX:?MSYSTEM_PREFIX must be set for Windows builds}"
export PATH="${MSYSTEM_PREFIX}/bin:${PATH}"

case "${MSYSTEM:-}" in
UCRT64)
c_compiler=gcc
cxx_compiler=g++
;;
CLANGARM64)
c_compiler=clang
cxx_compiler=clang++
;;
*)
echo "Unsupported MSYSTEM for Windows builds: ${MSYSTEM:-}" >&2
exit 1
;;
esac

for tool in "${c_compiler}" "${cxx_compiler}" ninja cmake; do
if ! command -v "${tool}" >/dev/null 2>&1; then
echo "Missing Windows build tool: ${tool}" >&2
exit 1
fi
done

cmake_args+=(
-G Ninja
-DCMAKE_MAKE_PROGRAM=ninja
-DCMAKE_C_COMPILER="${c_compiler}"
-DCMAKE_CXX_COMPILER="${cxx_compiler}"
-DCMAKE_PREFIX_PATH="${MSYSTEM_PREFIX}"
-DLUA_INCLUDE_DIR="${MSYSTEM_PREFIX}/include/lua5.4"
-DLUA_LIBRARIES="${MSYSTEM_PREFIX}/lib/liblua5.4.dll.a"
)
fi

cmake -Wno-dev -S . -B "$build_dir" "${cmake_args[@]}"
# Force single-job builds in CI. Bare --parallel with Unix Makefiles becomes
# gmake -j (unbounded), which can OOM GitHub-hosted runners on this project.
Expand Down
41 changes: 41 additions & 0 deletions .github/scripts/run-system-tests-windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -ne 3 ]; then
echo "usage: $0 <binary-path> <repo-root> <msys-prefix-path>" >&2
exit 1
fi

binary_path="$1"
repo_root="$2"
msys_prefix="$3"

[ -x "$binary_path" ] || {
echo "rqp binary missing or not executable: $binary_path" >&2
exit 1
}

[ -d "$repo_root/tests/system/fixtures/demo-plugin" ] || {
echo "system-test fixture missing under tests/system/fixtures/demo-plugin" >&2
exit 1
}

export PATH="${msys_prefix}/bin:${PATH}"

work_dir="$(mktemp -d)"
trap 'rm -rf "$work_dir"' EXIT INT TERM HUP

workspace_dir="$work_dir/workspace"
plugin_dir="$workspace_dir/plugins/demo-plugin"
report_path="$workspace_dir/plugin-test-report.json"

mkdir -p "$plugin_dir"
cp -R "$repo_root/tests/system/fixtures/demo-plugin/." "$plugin_dir/"

config_path="$("${repo_root}/.github/scripts/create-system-test-config.sh" "$workspace_dir" "$workspace_dir/plugins")"

"$binary_path" --help >/dev/null
"$binary_path" version >/dev/null
"$binary_path" --config "$config_path" test-plugin --plugin "$plugin_dir" --preset core --report "$report_path"

grep -F '"failed": 0' "$report_path" >/dev/null
13 changes: 13 additions & 0 deletions .github/scripts/setup-sol2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,24 @@ cache_sol_dir="${cache_root%/}/sol"

install -d "$sol_dir" "$cache_sol_dir"

patch_sol_optional_construct() {
local header="$1"
if grep -q 'this->construct(std::forward<Args>(args)...);' "$header"; then
local tmp
tmp="$(mktemp)"
sed 's/this->construct(std::forward<Args>(args)...);/new (static_cast<void*>(this)) optional(std::in_place, std::forward<Args>(args)...); return **this;/g' "$header" > "$tmp"
mv "$tmp" "$header"
fi
}

for header in sol.hpp config.hpp forward.hpp; do
if [ ! -f "$cache_sol_dir/$header" ]; then
tmp_file="$cache_sol_dir/$header.tmp"
curl --retry 5 --retry-all-errors --retry-delay 2 -fsSL "${base_url}/$header" -o "$tmp_file"
mv "$tmp_file" "$cache_sol_dir/$header"
fi
if [ "$header" = "sol.hpp" ]; then
patch_sol_optional_construct "$cache_sol_dir/$header"
fi
install -m 0644 "$cache_sol_dir/$header" "$sol_dir/$header"
done
8 changes: 8 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@ jobs:
contents: write
env:
SOL2_VERSION: v3.3.0
GO_VERSION: "1.23"
COVERAGE_BUILD_DIR: build/coverage
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: tools/trivydb-exporter/go.sum

- name: Install Linux dependencies
run: |
sudo apt-get update
Expand All @@ -47,6 +54,7 @@ jobs:
cmake -S . -B "${COVERAGE_BUILD_DIR}" \
-DCMAKE_BUILD_TYPE=Debug \
-DREQPACK_ENABLE_COVERAGE=ON \
-DREQPACK_GO_EXECUTABLE="$(command -v go)" \
-DSOL2_INCLUDE_DIR="${SOL2_INCLUDE_DIR}"

- name: Build coverage targets
Expand Down
35 changes: 30 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ defaults:

env:
RELEASE_ID: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || github.sha }}
GO_VERSION: "1.23"

jobs:
build-artifacts:
Expand Down Expand Up @@ -45,6 +46,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: tools/trivydb-exporter/go.sum

- name: Compute cache scope
id: cache-scope
run: echo "week=$(date -u +%G-W%V)" >> "$GITHUB_OUTPUT"
Expand All @@ -69,12 +76,13 @@ jobs:
- name: Install macOS dependencies
if: matrix.family == 'macos'
run: |
brew install ccache cmake cli11 fmt spdlog boost zstd openssl@3 lua@5.4
brew install ccache cmake cli11 fmt spdlog boost zstd openssl@3 lua@5.4 go
{
echo "BREW_PREFIX=$(brew --prefix)"
echo "OPENSSL_PREFIX=$(brew --prefix openssl@3)"
echo "LUA_PREFIX=$(brew --prefix lua@5.4)"
echo "ZSTD_PREFIX=$(brew --prefix zstd)"
echo "PATH=$(brew --prefix go)/bin:${PATH}"
} >> "$GITHUB_ENV"

- name: Install sol2 headers
Expand Down Expand Up @@ -104,6 +112,9 @@ jobs:
- name: Build macOS targets
if: matrix.family == 'macos'
run: |
export PATH="$(brew --prefix go)/bin:${PATH}"
command -v go
go version
export PKG_CONFIG_PATH="${OPENSSL_PREFIX}/lib/pkgconfig:${LUA_PREFIX}/lib/pkgconfig:${ZSTD_PREFIX}/lib/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
rm -rf build release-artifacts build-artifacts
bash .github/scripts/configure-build.sh build macos \
Expand Down Expand Up @@ -134,6 +145,7 @@ jobs:
unit-integration-tests:
name: ctest-${{ matrix.target }}
needs: build-artifacts
if: ${{ !cancelled() }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand All @@ -149,6 +161,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: tools/trivydb-exporter/go.sum

- name: Install Linux runtime dependencies
if: matrix.target != 'aarch64-darwin'
run: |
Expand All @@ -161,7 +179,7 @@ jobs:
- name: Install macOS runtime dependencies
if: matrix.target == 'aarch64-darwin'
run: |
brew install cmake cli11 fmt spdlog boost zstd openssl@3 lua@5.4
brew install cmake cli11 fmt spdlog boost zstd openssl@3 lua@5.4 go

- name: Download build tree artifact
uses: actions/download-artifact@v4
Expand All @@ -183,6 +201,7 @@ jobs:
needs:
- build-artifacts
- unit-integration-tests
if: ${{ !cancelled() }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -215,25 +234,31 @@ jobs:
"${{ matrix.target }}"

system-tests-macos:
name: system-macos-aarch64-darwin
name: system-macos-${{ matrix.target }}
needs:
- build-artifacts
- unit-integration-tests
if: ${{ !cancelled() }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download release bundle
uses: actions/download-artifact@v4
with:
name: release-bundle-aarch64-darwin
name: release-bundle-${{ matrix.target }}
path: release-artifacts

- name: Run native system tests
run: |
bash .github/scripts/run-system-tests-macos.sh \
"release-artifacts/rqp-${{ env.RELEASE_ID }}-aarch64-darwin.tar.gz" \
"release-artifacts/rqp-${{ env.RELEASE_ID }}-${{ matrix.target }}.tar.gz" \
"${{ github.workspace }}"

publish-container-arch:
Expand Down
Loading
Loading