Skip to content

Prototype cicd pipeline to build on alma linux 9 #3

Prototype cicd pipeline to build on alma linux 9

Prototype cicd pipeline to build on alma linux 9 #3

Workflow file for this run

name: Build AlmaLinux Pipeline
on:
push:
branches:
- master
pull_request:
branches:
- '*'
env:
DOCKERFILE: docker/Dockerfile.alma
DOCKER_BUILDIMAGE: libcore-alma
IMAGE_WORKDIR: /mnt/workspace
jobs:
build:
strategy:
matrix:
compiler: [
{ c: "gcc-11", cxx: "g++-11", package: "gcc-11 g++-11" },
{ c: "clang-14", cxx: "clang++-14", package: "clang-14" }
]
runs-on: ubuntu-latest
name: Build AlmaLinux / ${{ 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 debian docker image
run: |
docker build -t ${{ env.DOCKER_BUILDIMAGE }}:latest -f ${{ env.DOCKERFILE }} .
- name: Build & Test
run: |
buildTypes=("debug" "release")
for buildType in "${buildTypes[@]}"; do
export BUILD_DIRECTORY=build/$buildType
docker run --rm -v $(pwd):${{ env.IMAGE_WORKDIR }} ${{ env.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 }}
cmake --build $BUILD_DIRECTORY -j10
cd $BUILD_DIRECTORY && ctest -j8 -T test --no-compress-output
"
done