-
Notifications
You must be signed in to change notification settings - Fork 36
45 lines (43 loc) · 1.46 KB
/
pre-commit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: pre-commit
on: [push, pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- 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"
cd podio
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 -B build
cmake --build build --target install
source init.sh && source env.sh
echo "::endgroup::"
echo "::group::Run pre-commit"
cd $STARTDIR
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 -B build
ln -s $(pwd)/build/compile_commands.json ./compile_commands.json
pre-commit run --show-diff-on-failure \
--color=always \
--all-files
echo "::endgroup::"