Remove global variables #156
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Generate compilation database | |
run: | | |
# There are some errors when running the script, but they don't affect anything important. | |
# We only need to run it to set up some environment variables, so we suppress the output. | |
source setup.sh 1> /dev/null 2> /dev/null | |
pip install compiledb compdb | |
cd SDL | |
make BACKEND=cpu explicit_cache -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 | |
- name: Run linter | |
uses: cpp-linter/cpp-linter-action@v2 | |
id: linter | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
version: 16 | |
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: '-U_OPENMP -ferror-limit=0' | |
- name: Fail job if there were checks that failed | |
if: steps.linter.outputs.checks-failed > 0 | |
run: exit 1 |