Skip to content

Commit 5d8923f

Browse files
committed
Skip also CodeQL workflow
1 parent 1a24c23 commit 5d8923f

File tree

1 file changed

+18
-26
lines changed

1 file changed

+18
-26
lines changed

.github/workflows/codeql.yml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,100 +5,92 @@ on:
55
branches: [ "development" ]
66
pull_request:
77
branches: [ "development" ]
8-
schedule:
9-
- cron: "27 3 * * 0"
108

119
concurrency:
1210
group: ${{ github.ref }}-${{ github.head_ref }}-codeql
1311
cancel-in-progress: true
1412

1513
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1619
analyze:
1720
name: Analyze
1821
runs-on: ubuntu-24.04
19-
if: github.event.pull_request.draft == false
22+
needs: check_changes
23+
if: ${{ github.event.pull_request.draft == false }}
2024
permissions:
2125
actions: read
2226
contents: read
2327
security-events: write
24-
2528
strategy:
2629
fail-fast: false
2730
matrix:
2831
language: [ python, cpp ]
29-
3032
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v4
33-
33+
- uses: actions/checkout@v4
3434
- uses: actions/setup-python@v5
3535
name: Install Python
36+
if: ${{ needs.check_changes.outputs.has_non_docs_changes == 'true' }}
3637
with:
3738
python-version: '3.x'
38-
3939
- name: Install Packages (C++)
40-
if: ${{ matrix.language == 'cpp' }}
40+
if: ${{ matrix.language == 'cpp' && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
4141
run: |
4242
sudo apt-get update
4343
sudo apt-get install --yes cmake openmpi-bin libopenmpi-dev libhdf5-openmpi-dev libadios-openmpi-dev ccache
44-
4544
python -m pip install --upgrade pip
4645
python -m pip install --upgrade pipx
4746
python -m pip install --upgrade wheel
4847
python -m pip install --upgrade cmake
4948
python -m pipx install cmake
50-
5149
- name: Set Up Cache
52-
if: ${{ matrix.language == 'cpp' }}
50+
if: ${{ matrix.language == 'cpp' && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
5351
uses: actions/cache@v4
5452
with:
5553
path: ~/.cache/ccache
5654
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
5755
restore-keys: |
5856
ccache-${{ github.workflow }}-${{ github.job }}-git-
59-
6057
- name: Configure (C++)
61-
if: ${{ matrix.language == 'cpp' }}
58+
if: ${{ matrix.language == 'cpp' && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
6259
run: |
6360
cmake -S . -B build -DWarpX_OPENPMD=ON
64-
6561
- name: Initialize CodeQL
62+
if: ${{ needs.check_changes.outputs.has_non_docs_changes == 'true' }}
6663
uses: github/codeql-action/init@v3
6764
with:
6865
config-file: ./.github/codeql/warpx-codeql.yml
6966
languages: ${{ matrix.language }}
7067
queries: +security-and-quality
71-
7268
- name: Build (py)
7369
uses: github/codeql-action/autobuild@v3
74-
if: ${{ matrix.language == 'python' }}
75-
70+
if: ${{ matrix.language == 'python' && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
7671
- name: Build (C++)
77-
if: ${{ matrix.language == 'cpp' }}
72+
if: ${{ matrix.language == 'cpp' && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
7873
run: |
7974
export CCACHE_COMPRESS=1
8075
export CCACHE_COMPRESSLEVEL=10
8176
export CCACHE_MAXSIZE=100M
8277
ccache -z
83-
8478
cmake --build build -j 4
85-
8679
ccache -s
8780
du -hs ~/.cache/ccache
88-
8981
# Make sure CodeQL has something to do
9082
touch Source/Utils/WarpXVersion.cpp
9183
export CCACHE_DISABLE=1
9284
cmake --build build -j 4
93-
9485
- name: Perform CodeQL Analysis
86+
if: ${{ needs.check_changes.outputs.has_non_docs_changes == 'true' }}
9587
uses: github/codeql-action/analyze@v3
9688
with:
9789
category: "/language:${{ matrix.language }}"
9890
upload: False
9991
output: sarif-results
100-
10192
- name: filter-sarif
93+
if: ${{ needs.check_changes.outputs.has_non_docs_changes == 'true' }}
10294
uses: advanced-security/filter-sarif@v1
10395
with:
10496
patterns: |
@@ -111,8 +103,8 @@ jobs:
111103
-build/_deps/*/*/*/*/*/*/*/*
112104
input: sarif-results/${{ matrix.language }}.sarif
113105
output: sarif-results/${{ matrix.language }}.sarif
114-
115106
- name: Upload SARIF
107+
if: ${{ needs.check_changes.outputs.has_non_docs_changes == 'true' }}
116108
uses: github/codeql-action/upload-sarif@v3
117109
with:
118110
sarif_file: sarif-results/${{ matrix.language }}.sarif

0 commit comments

Comments
 (0)