CI / pre-commit (push) Successful in 56s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-arm64, ubuntu-latest-arm64) (push) Successful in 2m24s
CI / build (-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++, clang-amd64, ubuntu-latest-amd64) (push) Successful in 2m53s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-arm64, ubuntu-latest-arm64) (push) Successful in 2m44s
CI / build (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc-amd64, ubuntu-latest-amd64) (push) Successful in 3m9s
Closes #5 Adds a Gitea Actions workflow that runs pre-commit checks and builds/tests the project on clang and gcc for both amd64 and arm64. weaseljson is checked out, built, and installed locally because weaseldb depends on it via `find_package(weaseljson REQUIRED)`. Also switches the llhttp FetchContent declaration from a tarball URL to a git repository pinned to the same release commit. The tarball redirect goes through codeload.github.com, which can be blocked in restricted network environments; using git keeps the fetch on github.com. Reviewed-on: #6 Co-authored-by: Weaselbot <weaselbot@weaselab.dev> Co-committed-by: Weaselbot <weaselbot@weaselab.dev>
70 lines
2.0 KiB
YAML
70 lines
2.0 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-latest-amd64
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install pre-commit
|
|
run: pipx install pre-commit
|
|
|
|
- name: Run pre-commit
|
|
run: ~/.local/bin/pre-commit run --all-files --show-diff-on-failure
|
|
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: clang-amd64
|
|
runner: ubuntu-latest-amd64
|
|
cmake_args: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
|
- name: clang-arm64
|
|
runner: ubuntu-latest-arm64
|
|
cmake_args: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
|
- name: gcc-amd64
|
|
runner: ubuntu-latest-amd64
|
|
cmake_args: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
|
- name: gcc-arm64
|
|
runner: ubuntu-latest-arm64
|
|
cmake_args: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
path: weaseldb
|
|
|
|
- name: Checkout weaseljson
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: weaselab/weaseljson
|
|
path: weaseljson
|
|
|
|
- name: Install deps
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential clang cmake gperf
|
|
|
|
- name: Build and install weaseljson
|
|
run: |
|
|
cmake -S weaseljson -B weaseljson/build \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_INSTALL_PREFIX="$(pwd)/weaseljson/install"
|
|
cmake --build weaseljson/build -j "$(nproc)"
|
|
cmake --install weaseljson/build
|
|
|
|
- name: Build weaseldb
|
|
run: |
|
|
cmake -S weaseldb -B weaseldb/build ${{ matrix.cmake_args }} \
|
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
|
-DCMAKE_PREFIX_PATH="$(pwd)/weaseljson/install"
|
|
cmake --build weaseldb/build -j "$(nproc)"
|
|
|
|
- name: Test
|
|
run: |
|
|
cd weaseldb/build
|
|
ctest --output-on-failure -j "$(nproc)" --timeout 90
|