Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Rework workflows to make them a bit easier to maintain #360

Merged
merged 7 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 24 additions & 32 deletions .github/workflows/lcg_linux_with_podio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,46 @@ jobs:
"LCG_106/x86_64-el9-gcc13-opt"]
CXX_STANDARD: [20]
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: AIDASoft/podio
path: podio
- uses: cvmfs-contrib/github-action-cvmfs@v4
- uses: aidasoft/run-lcg-view@v4
with:
release-platform: ${{ matrix.LCG }}
run: |
STARTDIR=$(pwd)
echo "::group::Build podio"
echo "Building podio @"$(git log -1 --format=%H)
git clone --depth 1 https://github.com/AIDASoft/podio
cd podio
mkdir build install
cd build
cmake .. -DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }} \
echo "Building podio @"$(git log -1 --format=%H)
cmake -DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }} \
-DENABLE_SIO=ON \
-DENABLE_RNTUPLE=ON \
-DENABLE_DATASOURCE=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \
-G Ninja
ninja -k0
ninja install
cd ..
export ROOT_INCLUDE_PATH=$(pwd)/install/include:$ROOT_INCLUDE_PATH:$CPATH
unset CPATH
export CMAKE_PREFIX_PATH=$(pwd)/install:$CMAKE_PREFIX_PATH
export LD_LIBRARY_PATH=$(pwd)/install/lib:$(pwd)/install/lib64:$LD_LIBRARY_PATH
export PYTHONPATH=$(pwd)/install/lib/python3$(python -c 'import sys; print(sys.version_info[1])')/site-packages:$PYTHONPATH
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-G Ninja -B build
cmake --build build --target install -- -k0
source init.sh && source env.sh
echo "::endgroup::"
echo "::group::Build edm4hep"
cd $STARTDIR
echo "Building edm4hep"
mkdir build install
cd build
cmake .. -DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }} \
-DCMAKE_INSTALL_PREFIX=../install \
cmake -DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }} \
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-DUSE_EXTERNAL_CATCH2=OFF \
-G Ninja
ninja -k0
ctest --output-on-failure
ninja install
cd -
-G Ninja -B build
cmake --build build -- -k0
ctest --test-dir build --output-on-failure
cmake --build build --target install
echo "::endgroup::"
echo "::group::Test downstream usage"
export CMAKE_PREFIX_PATH=$PWD/install:$CMAKE_PREFIX_PATH
cd test/downstream-project-cmake-test
mkdir build
cd build
cmake .. -DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }} \
-DCMAKE_INSTALL_PREFIX=../install \
-G Ninja
ninja -k0
cmake -DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }} \
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-G Ninja -B build
cmake --build build -- -k0
echo "::endgroup::"
44 changes: 18 additions & 26 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,39 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: AIDASoft/podio
path: podio
- uses: cvmfs-contrib/github-action-cvmfs@v4
- uses: aidasoft/run-lcg-view@v4
with:
release-platform: LCG_104/x86_64-el9-clang16-opt
run: |
STARTDIR=$(pwd)
echo "::group::Build podio"
echo "Building podio @"$(git log -1 --format=%H)
git clone --depth 1 https://github.com/AIDASoft/podio
cd podio
mkdir build install
cd build
cmake .. -DCMAKE_CXX_STANDARD=20 \
echo "Building podio @"$(git log -1 --format=%H)
cmake -DCMAKE_CXX_STANDARD=20 \
-DENABLE_SIO=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \
-G Ninja
ninja -k0
ninja install
cd ..
export ROOT_INCLUDE_PATH=$(pwd)/install/include:$ROOT_INCLUDE_PATH:$CPATH
unset CPATH
export CMAKE_PREFIX_PATH=$(pwd)/install:$CMAKE_PREFIX_PATH
export LD_LIBRARY_PATH=$(pwd)/install/lib:$(pwd)/install/lib64:$LD_LIBRARY_PATH
-DCMAKE_INSTALL_PREFIX=$(pwd)/install \
-G Ninja -B build
cmake --build build --target install
source init.sh && source env.sh
echo "::endgroup::"
echo "::group::Run pre-commit"
cd $STARTDIR
export PYTHONPATH=$(python -m site --user-site):$PYTHONPATH
export PATH=/root/.local/bin:$PATH
pip install argparse --user
mkdir build
cd build
cmake .. -DENABLE_SIO=ON \
python3 -m venv /root/pre-commit-venv
source /root/pre-commit-venv/bin/activate
pip install pre-commit
cmake -DENABLE_SIO=ON \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror "\
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DUSE_EXTERNAL_CATCH2=OFF
ln -s $(pwd)/compile_commands.json ../
cd ..
pip install pre-commit --user
-DUSE_EXTERNAL_CATCH2=OFF -B build
ln -s $(pwd)/build/compile_commands.json ./compile_commands.json
pre-commit run --show-diff-on-failure \
--color=always \
--all-files
Expand Down
Loading