Skip to content

Consolidate changes after ab3be152 #33

Consolidate changes after ab3be152

Consolidate changes after ab3be152 #33

Workflow file for this run

name: Raijin-LOB Engine CI
on:
push:
branches: ["main", "master"]
paths:
- 'src/**'
- 'include/**'
- 'tests/**'
- 'benchmarks/**'
- 'CMakeLists.txt'
- 'third_party/**'
- '.github/workflows/ci.yaml'
- '**.cpp'
- '**.hpp'
pull_request:
branches: ["main", "master"]
paths:
- 'src/**'
- 'include/**'
- 'tests/**'
- 'benchmarks/**'
- 'CMakeLists.txt'
- 'third_party/**'
- '.github/workflows/ci.yaml'
- '**.cpp'
- '**.hpp'
permissions:
contents: write
jobs:
build-and-test:
name: Build and Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Install depedencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake clang-tidy clang-format
#- name: Run Clang-Format Check
# run: |
# find src include tests -name "*.cpp" -o -name "*.hpp" | xargs clang-format --dry-run --Werror
#- name: Run Clang-Tidy (Linter)
# run: |
# # Run the linter on all our source files
# clang-tidy src/core/*.cpp include/core/*.hpp -- -Iinclude -Ithird_party/json/include -std=c++20
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
- name: Build
run: |
cd build
make -j$(nproc)
- name: Run tests
run: |
cd build
ctest --output-on-failure
run-benchmarks:
name: Performance Benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
- name: Configure and Build
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc) raijin_benchmarks
- name: Run Benchmarks and Auto-Update Markdown
run: |
cd build
echo "# Raijin-LOB Performance Benchmarks" > ../BENCHMARKS.md
echo '```text' >> ../BENCHMARKS.md
./raijin_benchmarks >> ../BENCHMARKS.md
echo '```' >> ../BENCHMARKS.md
cd ..
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add BENCHMARKS.md
if ! git diff --cached --quiet; then
git commit -m "docs: auto-update BENCHMARKS.md [skip ci]"
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
git push
else
echo "Benchmark updated locally; skipping push for PR check."
fi
fi