Skip to content

Commit

Permalink
Run pre-commit on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Sep 24, 2024
1 parent 86e2ba9 commit a3bcf14
Showing 1 changed file with 23 additions and 35 deletions.
58 changes: 23 additions & 35 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,26 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
- uses: aidasoft/run-lcg-view@v4
with:
container: el9
view-path: /cvmfs/sw-nightlies.hsf.org/key4hep
run: |
echo "::group::Setup pre-commit"
# Newer versions of git are more cautious around the github runner
# environment and without this git rev-parse --show-cdup in pre-commit
# fails
git config --global --add safe.directory $(pwd)
python -m venv /root/pre-commit-venv
source /root/pre-commit-venv/bin/activate
pip install pre-commit
pip install pylint==2.17.7
pip install flake8
echo "::endgroup::"
echo "::group::Run CMake"
mkdir build
cd build
cmake .. -DENABLE_SIO=ON \
-DENABLE_JULIA=ON \
-DENABLE_RNTUPLE=ON \
-DENABLE_DATASOURCE=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 ..
echo "::endgroup::"
echo "::group::Run pre-commit"
pre-commit run --show-diff-on-failure \
--color=always \
--all-files
echo "::endgroup::"
- name: Setup Key4hep nightlies
run: source /cvmfs/sw-nightlies.hsf.org/key4hep
- name: Setup pre-commit
run: |
python -m venv pre-commit-venv
source pre-commit-venv/bin/activate
pip install pre-commit pylint==2.17.7 flake8
- name: Run CMake
run: |
cmake -S . -B build -DENABLE-SIO=ON \
-DENABLE_JULIA=ON \
-DENABLE_RNTUPLE=ON \
-DENABLE_DATASOURCE=ON \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror "\
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DUSE_EXTERNAL_CATCH2=OFF
ln -s build/compile_commands.json compile_commands.json
- name: Run pre-commit
run: |
pre-commit run --show-diff-on-failure \
--color=always \
--all-files

0 comments on commit a3bcf14

Please sign in to comment.