Skip to content

Commit

Permalink
CodeQL CXX: Filter More
Browse files Browse the repository at this point in the history
Try to avoid running out of disk space during analysis.
  • Loading branch information
ax3l committed Aug 2, 2024
1 parent 0b13029 commit af00da3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/codeql/pyamrex-codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: "pyAMReX CodeQL config"

# ignore AMReX from superbuild
# note: not yet suppored, thus doing post-analysis SARIF filtering
paths-ignore:
- build/_deps
37 changes: 33 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ jobs:
-DCMAKE_CXX_COMPILER="/usr/local/bin/g++"
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Build (py)
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
if: ${{ matrix.language == 'python' }}

- name: Build (C++)
Expand All @@ -87,11 +87,40 @@ jobs:
du -hs ~/.cache/ccache
# Make sure CodeQL has something to do
touch build/_deps/fetchedamrex-src/Src/Base/AMReX.cpp
touch src/pyAMReX.cpp
export CCACHE_DISABLE=1
$CMAKE --build build -j 4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"

- name: filter-sarif
uses: advanced-security/filter-sarif@v1
with:
patterns: |
-build/_deps/*/*
-build/_deps/*/*/*
-build/_deps/*/*/*/*
-build/_deps/*/*/*/*/*
-build/_deps/*/*/*/*/*/*
-build/_deps/*/*/*/*/*/*/*
-build/_deps/*/*/*/*/*/*/*/*
input: sarif-results/${{ matrix.language }}.sarif
output: sarif-results/${{ matrix.language }}.sarif

save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1

0 comments on commit af00da3

Please sign in to comment.