Move test fixture to seperate repo #128
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Pipeline | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- '*' | |
env: | |
DOCKER_BUILDIMAGE_WORKDIR: /mnt/workspace | |
jobs: | |
build: | |
strategy: | |
matrix: | |
distro: [debian, almalinux, ubuntu-24.04, ubuntu-20.04] | |
compiler: [ | |
{ c: "gcc-11", cxx: "g++-11" }, | |
{ c: "clang-14", cxx: "clang++-14" } | |
] | |
runs-on: ubuntu-latest | |
name: Build ${{ matrix.distro }} / ${{ matrix.compiler.cxx }} | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
submodules: recursive | |
- name: Build docker image ${{ matrix.distro }} | |
run: | | |
if [[ "${{ matrix.distro }}" == "debian" ]]; then | |
export DOCKERFILE=docker/Dockerfile.debian | |
elif [[ "${{ matrix.distro }}" == "almalinux" ]]; then | |
export DOCKERFILE=docker/Dockerfile.alma | |
elif [[ "${{ matrix.distro }}" == "ubuntu-24.04" ]]; then | |
export DOCKERFILE=docker/Dockerfile.ubuntu2404 | |
elif [[ "${{ matrix.distro }}" == "ubuntu-20.04" ]]; then | |
export DOCKERFILE=docker/Dockerfile.ubuntu2004 | |
else | |
exit 1 | |
fi | |
export DOCKER_BUILDIMAGE=libcore-${{ matrix.distro }} | |
docker build -t $DOCKER_BUILDIMAGE:latest -f $DOCKERFILE . | |
- name: Build & Test | |
run: | | |
export DOCKER_BUILDIMAGE=libcore-${{ matrix.distro }} | |
buildTypes=("debug" "release") | |
for buildType in "${buildTypes[@]}"; do | |
export BUILD_DIRECTORY=build/$buildType | |
docker run --rm -v $(pwd):${{ env.DOCKER_BUILDIMAGE_WORKDIR }} $DOCKER_BUILDIMAGE:latest sh -c " \ | |
cmake -S . -B $BUILD_DIRECTORY \ | |
-DCMAKE_BUILD_TYPE=$buildType \ | |
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} \ | |
-Dlibcore_ENABLE_TESTS=ON | |
cmake --build $BUILD_DIRECTORY -j10 | |
cd $BUILD_DIRECTORY && ctest -j8 -T test --no-compress-output | |
" | |
done |