diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml index 0fe3a55..ef2627c 100644 --- a/.github/workflows/clang-format-check.yml +++ b/.github/workflows/clang-format-check.yml @@ -5,17 +5,20 @@ on: [push, pull_request] jobs: clang-format: runs-on: ubuntu-latest - container: debian:stable-slim steps: - - - name: Install clang-format + - uses: actions/checkout@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v3.1 + - name: Start container run: | - apt-get update - apt-get install -y curl git - curl -SL https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-208096c1/clang-format-14_linux-amd64 > /usr/local/bin/clang-format - chmod +x /usr/local/bin/clang-format - - - uses: actions/checkout@v2 + docker run \ + -it --name k4Acts_CI \ + -v ${{ github.workspace }}:/k4Acts \ + -v /cvmfs:/cvmfs:shared \ + -d ghcr.io/aidasoft/centos7:latest /bin/bash - - name: Run format - run: ci/format.sh . + - name: Check Format + run: | + docker exec k4Acts_CI /bin/bash -c 'source /cvmfs/sft.cern.ch/lcg/releases/clang/10.0.0-62e61/x86_64-centos7/setup.sh;\ + clang-format -Werror --verbose --dry-run --style=file $(find ./k4Acts/ -name "*.cpp" -o -name "*.h" );\ + exit $?;\ + ' diff --git a/.github/workflows/downstream-build.yaml b/.github/workflows/downstream-build.yaml index e763bb4..30ed5c7 100644 --- a/.github/workflows/downstream-build.yaml +++ b/.github/workflows/downstream-build.yaml @@ -11,5 +11,5 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v3 - - uses: cvmfs-contrib/github-action-cvmfs@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v3.1 - uses: key4hep/key4hep-actions/downstream-build@main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9a95d72..c2ed981 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,6 @@ name: linux -on: - push: - pull_request: +on: [push, pull_request] jobs: test: @@ -12,35 +10,27 @@ jobs: matrix: SETUP: ['/cvmfs/sw.hsf.org/key4hep/setup.sh', '/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh'] steps: - - uses: actions/checkout@v2 - - uses: cvmfs-contrib/github-action-cvmfs@v2 + - uses: actions/checkout@v3 + - uses: cvmfs-contrib/github-action-cvmfs@v3.1 - 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 -# - name: CMake Configure -# run: | -# docker exec CI_container /bin/bash -c 'cd Package;\ -# mkdir -p build install;\ -# git submodule init;\ -# git submodule update;\ -# source ${{ matrix.SETUP }};\ -# 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 }};\ -# cd build;\ -# ninja -k0;' -# - name: Install -# run: | -# docker exec CI_container /bin/bash -c 'cd ./Package;\ -# source ${{ matrix.SETUP }};\ -# cd build;\ -# ninja -k0 install;' -# - name: Test + docker run \ + -it --name k4Acts_CI \ + -v ${{ github.workspace }}:/k4Acts \ + -v /cvmfs:/cvmfs:shared \ + -d ghcr.io/aidasoft/centos7:latest /bin/bash + - name: Compile + run: | + docker exec k4Acts_CI /bin/bash -c 'source ${{ matrix.SETUP }}; + cd k4Acts; + mkdir build install; cd build; + cmake -G Ninja -D CMAKE_INSTALL_PREFIX=$PWD/../install -D CMAKE_BUILD_TYPE=RelWithDebInfo ..; + ninja install; + ' + +# - name: Run tests (CTest) # run: | -# docker exec CI_container /bin/bash -c 'cd ./Package;\ -# source ${{ matrix.SETUP }};\ -# cd build;\ -# ninja -k0 && ctest --output-on-failure;' +# docker exec k4Acts_CI /bin/bash -c 'source ${{ matrix.SETUP }}; +# cd k4Acts/build; +# ctest --output-on-failure; +# '