Skip to content

build-and-test

build-and-test #117

Workflow file for this run

name: build-and-test
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
STACK: ['/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh']
OS: ['alma9',
'ubuntu22']
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
docker run -it --name CI_container \
-v ${GITHUB_WORKSPACE}:/Package \
-v /cvmfs:/cvmfs:shared \
-p 80:80 \
-d ghcr.io/key4hep/key4hep-images/${{ matrix.OS }}:latest \
/bin/bash
- name: CMake Configure
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
mkdir -p build install; \
source ${{ matrix.STACK }}; \
cd build; \
cmake -DCMAKE_INSTALL_PREFIX=../install ..'
- name: Compile and Install
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
cd build; \
make ral install'
- name: Compile tests
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
cd build; \
make unittest'
- name: Run unittest
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
cd build; \
ctest -R unittest --output-on-failure'
- name: Run integration tests
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
k4_local_repo; \
cd build; \
ctest -R integration --output-on-failure'