diff --git a/.github/workflows/key4hep-build.yaml b/.github/workflows/key4hep-build.yaml index bb3dbf75..ce5b59f9 100644 --- a/.github/workflows/key4hep-build.yaml +++ b/.github/workflows/key4hep-build.yaml @@ -1,13 +1,75 @@ name: Key4hep build on: - pull_request: + push: + branches: + - main workflow_dispatch: +build_commands: &build_commands | + source ${{ matrix.release }}/setup.sh + mkdir build + cd build + cmake .. -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=../install -G Ninja + ninja install + ctest -j $(nproc) --output-on-failure + +build_strategy: &build_strategy + strategy: + fail-fast: false + matrix: + release: ["sw.hsf.org/key4hep", + "sw-nightlies.hsf.org/key4hep"] + jobs: - test: + job1: runs-on: ubuntu-latest + container: + image: ghcr.io/key4hep-images/alma9-build:latest + + <<: *build_strategy + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up CVMFS + uses: cvmfs-contrib/github-action-cvmfs@v3 + + - name: Setup environment and build + run: *build_commands + + job2: + runs-on: ubuntu-latest + container: + image: ghcr.io/key4hep-images/ubuntu22-build:latest + + <<: *build_strategy + steps: - - uses: actions/checkout@v3 - - uses: cvmfs-contrib/github-action-cvmfs@v3 - - uses: key4hep/key4hep-actions/key4hep-build-test@main \ No newline at end of file + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up CVMFS + uses: cvmfs-contrib/github-action-cvmfs@v3 + + - name: Setup environment and build + run: *build_commands + + + job3: + runs-on: ubuntu-latest + container: + image: ghcr.io/key4hep-images/centos7-build:latest + + <<: *build_strategy + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up CVMFS + uses: cvmfs-contrib/github-action-cvmfs@v3 + + - name: Setup environment and build + run: *build_commands