Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Test PR

Test PR #11

Workflow file for this run

name: Static checks
on:
pull_request:
branches: master
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
linter:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout PR
uses: actions/checkout@v4
- name: Mount cvmfs
uses: cvmfs-contrib/github-action-cvmfs@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Generate compilation database
working-directory: ./SDL
run: |
pip install compiledb compdb
make BACKEND=cpu -Bnwk > build_log.txt
compiledb < build_log.txt
# This extra step is needed to generate compilation commands for headers
compdb list > compile_commands_new.json
mv compile_commands_new.json > compile_commands.json
# Now we gather some include paths since the compiler is not fully configured to find all the headers.
source setup.sh 1> /dev/null 2> /dev/null
INCLUDE_FLAGS="-I$TRACKLOOPERDIR -I$BOOST_ROOT/include -I$ALPAKA_ROOT/include -I$CUDA_HOME/include -I$ROOT_ROOT/include -I$CMSSW_BASE/src"
INCLUDE_FLAGS="$INCLUDE_FLAGS -I/cvmfs/cms.cern.ch/el8_amd64_gcc11/external/gcc/11.4.1-30ebdc301ebd200f2ae0e3d880258e65/include/c++/11.4.1"
INCLUDE_FLAGS="$INCLUDE_FLAGS -I/cvmfs/cms.cern.ch/el8_amd64_gcc11/external/gcc/11.4.1-30ebdc301ebd200f2ae0e3d880258e65/include/c++/11.4.1/x86_64-redhat-linux-gnu/"
INCLUDE_FLAGS="$INCLUDE_FLAGS -I/cvmfs/cms.cern.ch/el8_amd64_gcc11/external/gcc/11.4.1-30ebdc301ebd200f2ae0e3d880258e65/lib/gcc/x86_64-redhat-linux-gnu/11.4.1/include"
echo "include-flags=$INCLUDE_FLAGS" >> $GITHUB_ENV
- name: Run linter
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
thread-comments: true
# only use checks in .clang-tidy file
tidy-checks: ''
lines-changed-only: true
ignore: .github|bin|code|data|efficiency
extra-args: '-ferror-limit=0 ${{ env.include-flags }}'
- name: Fail job if there were checks that failed
if: steps.linter.outputs.checks-failed > 0
run: exit 1