-
Notifications
You must be signed in to change notification settings - Fork 119
34 lines (32 loc) · 1.1 KB
/
format.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
name: clang-format
on: [push, pull_request]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
docker run -it --name CI_container \
-v ${GITHUB_WORKSPACE}:/Package \
-v /cvmfs:/cvmfs:shared \
-d ghcr.io/key4hep/key4hep-images/alma9:latest \
/bin/bash
- name: Add upstream
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
git config --global --add safe.directory /Package; \
git remote add upstream https://github.com/HEP-FCC/FCCAnalyses.git; \
git fetch upstream'
- name: Run formatter
run: |
docker exec CI_container /bin/bash -c 'cd ./Package; \
source /cvmfs/sw.hsf.org/key4hep/setup.sh;\
git clang-format --style=file $(git merge-base upstream/master HEAD)'
- name: Check cleanliness
run: |
docker exec CI_container /bin/bash -c 'cd ./Package; \
git diff'