From b284c8b2612a93be0c69b925e773fc9104e8e21b Mon Sep 17 00:00:00 2001 From: Juraj Smiesko Date: Thu, 8 Feb 2024 10:49:17 +0100 Subject: [PATCH 1/2] Adding other OSes to the test CI --- .../{test.yml => build-and-test.yml} | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) rename .github/workflows/{test.yml => build-and-test.yml} (67%) diff --git a/.github/workflows/test.yml b/.github/workflows/build-and-test.yml similarity index 67% rename from .github/workflows/test.yml rename to .github/workflows/build-and-test.yml index 73e9415..26c1487 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,43 +1,49 @@ -name: linux +name: 'Build and Test' on: [push, pull_request] jobs: - test: + build-and-test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - SETUP: ['/cvmfs/sw.hsf.org/key4hep/setup.sh', '/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh'] + STACK: ['/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh', + '/cvmfs/sw.hsf.org/key4hep/setup.sh' + ] + OS: ['aidasoft/centos7', + 'key4hep/key4hep-images/alma9', + 'key4hep/key4hep-images/ubuntu22' + ] steps: - uses: actions/checkout@v2 - uses: cvmfs-contrib/github-action-cvmfs@v2 - name: Start container run: | - docker run -it --name CI_container -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/aidasoft/centos7:latest /bin/bash + docker run -it --name CI_container -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/${{ matrix.OS }}:latest /bin/bash - name: CMake Configure run: | docker exec CI_container /bin/bash -c 'cd Package;\ mkdir -p build install;\ - source ${{ matrix.SETUP }};\ + source ${{ matrix.STACK }};\ cd build;\ cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -G Ninja ..;' - name: Compile run: | docker exec CI_container /bin/bash -c 'cd ./Package;\ - source ${{ matrix.SETUP }};\ + source ${{ matrix.STACK }};\ cd build;\ ninja -k0;' - name: Install run: | docker exec CI_container /bin/bash -c 'cd ./Package;\ - source ${{ matrix.SETUP }};\ + source ${{ matrix.STACK }};\ cd build;\ ninja -k0 install;' - name: Test run: | docker exec CI_container /bin/bash -c 'cd ./Package;\ - source ${{ matrix.SETUP }};\ + source ${{ matrix.STACK }};\ cd build;\ ninja -k0 && ctest --output-on-failure;' From db27709cbb271a3f59d6bdfea0c639ad9fdabbe0 Mon Sep 17 00:00:00 2001 From: Juraj Smiesko Date: Thu, 22 Feb 2024 15:23:50 +0100 Subject: [PATCH 2/2] Using key4hep-build action --- .github/workflows/build-and-test.yml | 49 ---------------------------- .github/workflows/key4hep-build.yaml | 23 +++++++++++++ 2 files changed, 23 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/key4hep-build.yaml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml deleted file mode 100644 index 26c1487..0000000 --- a/.github/workflows/build-and-test.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: 'Build and Test' - -on: [push, pull_request] - -jobs: - build-and-test: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - STACK: ['/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh', - '/cvmfs/sw.hsf.org/key4hep/setup.sh' - ] - OS: ['aidasoft/centos7', - 'key4hep/key4hep-images/alma9', - 'key4hep/key4hep-images/ubuntu22' - ] - steps: - - uses: actions/checkout@v2 - - uses: cvmfs-contrib/github-action-cvmfs@v2 - - name: Start container - run: | - docker run -it --name CI_container -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/${{ 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 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -G Ninja ..;' - - name: Compile - run: | - docker exec CI_container /bin/bash -c 'cd ./Package;\ - source ${{ matrix.STACK }};\ - cd build;\ - ninja -k0;' - - name: Install - run: | - docker exec CI_container /bin/bash -c 'cd ./Package;\ - source ${{ matrix.STACK }};\ - cd build;\ - ninja -k0 install;' - - name: Test - run: | - docker exec CI_container /bin/bash -c 'cd ./Package;\ - source ${{ matrix.STACK }};\ - cd build;\ - ninja -k0 && ctest --output-on-failure;' - diff --git a/.github/workflows/key4hep-build.yaml b/.github/workflows/key4hep-build.yaml new file mode 100644 index 0000000..3f9007f --- /dev/null +++ b/.github/workflows/key4hep-build.yaml @@ -0,0 +1,23 @@ +name: Key4hep build + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + build_type: ["release", "nightly"] + image: ["alma9", "ubuntu22", "centos7"] + fail-fast: false + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: key4hep/key4hep-actions/key4hep-build@main + with: + build_type: ${{ matrix.build_type }} + image: ${{ matrix.image }}