Skip to content

Feat/clock

Feat/clock #323

Workflow file for this run

name: Build and test
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build-and-test:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false # Allow other builds to continue even if one fails
matrix:
include:
- runner: [self-hosted, X64]
name: x86_64
- runner: [self-hosted, ARM64]
name: aarch64
name: Build and Test (${{ matrix.name }})
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 100
- name: Pull LFS files
run: git lfs pull
- name: Fetch history for versioning
run: |
git fetch --unshallow --tags || git fetch --depth=100 --tags
- name: Install system dependencies and utilities
run: |
chmod +x ./toolchains/install_base.sh
./toolchains/install_base.sh
- name: Install CMake
run: |
chmod +x ./toolchains/install_cmake.sh
./toolchains/install_cmake.sh
- name: Install LLVM/Clang toolchain
run: |
chmod +x ./toolchains/install_llvm.sh
./toolchains/install_llvm.sh
- name: Install GCC toolchain
run: |
chmod +x ./toolchains/install_gcc.sh
./toolchains/install_gcc.sh
- name: Set cache directories
run: |
echo "CCACHE_DIR=$HOME/.cache/ccache" >> $GITHUB_ENV
echo "CTCACHE_DIR=$HOME/.cache/ctcache" >> $GITHUB_ENV
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: |
${{ env.CCACHE_DIR }}
${{ env.CTCACHE_DIR }}
key: grape-${{ runner.arch }}-${{ runner.os }}-cache
restore-keys: |
grape-${{ runner.arch }}-${{ runner.os }}-cache
- name: Configure (clang)
run: cmake --preset clang -DLINTER_WARNING_IS_ERROR=ON
- name: Check formatting
run: |
cmake --build build/clang --target format
if ! git diff --exit-code --quiet; then
echo "::error::Following files are incorrectly formatted"
git status
exit 1
fi
- name: Build (clang)
run: cmake --build build/clang --target all examples tests
- name: Run unit tests (clang)
run: cmake --build build/clang --target check
- name: Configure (gcc)
run: cmake --preset native -DENABLE_FORMATTER=OFF -DENABLE_LINTER=OFF
- name: Build (gcc)
run: cmake --build build/native --target all examples tests -j $(nproc)
- name: Run unit tests (gcc)
run: cmake --build build/native --target check
- name: Report ccache stats
run: ccache -s