Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/check_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- '!Docs/**'
- '!**.md'
- '!**.rst'
- '!.github/**' # FIXME
predicate-quantifier: 'every'
- id: set-output
run: |
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,32 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 250
needs: check_changes
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
if: ${{ github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v4
- name: install dependencies
if: ${{ needs.check_changes.outputs.has_non_docs_changes == 'true' }}
run: |
.github/workflows/dependencies/clang.sh 17
- name: set up cache
if: ${{ needs.check_changes.outputs.has_non_docs_changes == 'true' }}
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-${{ github.job }}-git-
- name: build WarpX & run clang-tidy
if: ${{ needs.check_changes.outputs.has_non_docs_changes == 'true' }}
run: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=300M
export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
ccache -z

export CXX=$(which clang++-17)
export CC=$(which clang-17)

cmake -S . -B build_clang_tidy \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DWarpX_DIMS="${{ matrix.dim }}" \
Expand All @@ -60,13 +61,10 @@ jobs:
-DWarpX_OPENPMD=ON \
-DWarpX_PRECISION=SINGLE \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache

cmake --build build_clang_tidy -j 4

${{github.workspace}}/.github/workflows/source/makeMakefileForClangTidy.py --input ${{github.workspace}}/ccache.log.txt
make -j4 --keep-going -f clang-tidy-ccache-misses.mak \
CLANG_TIDY=clang-tidy-17 \
CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*"

ccache -s
du -hs ~/.cache/ccache
32 changes: 11 additions & 21 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,52 @@ name: 🔍 CodeQL

on:
push:
branches: [ "development" ]
branches:
- "development"
pull_request:
branches: [ "development" ]
schedule:
- cron: "27 3 * * 0"
Comment on lines -8 to -9
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed cron schedule for CodeQL workflows (on Sundays at 3:27 AM...?).

branches:
- "development"

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

jobs:

check_changes:
name: Analyze
uses: ./.github/workflows/check_changes.yml

analyze:
name: Analyze
runs-on: ubuntu-24.04
if: github.event.pull_request.draft == false
needs: check_changes
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ python, cpp ]

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.x'

- name: Install Packages (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
sudo apt-get update
sudo apt-get install --yes cmake openmpi-bin libopenmpi-dev libhdf5-openmpi-dev libadios-openmpi-dev ccache

python -m pip install --upgrade pip
python -m pip install --upgrade pipx
python -m pip install --upgrade wheel
python -m pip install --upgrade cmake
python -m pipx install cmake

- name: Set Up Cache
if: ${{ matrix.language == 'cpp' }}
uses: actions/cache@v4
Expand All @@ -56,48 +56,39 @@ jobs:
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-${{ github.job }}-git-

- name: Configure (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
cmake -S . -B build -DWarpX_OPENPMD=ON

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
config-file: ./.github/codeql/warpx-codeql.yml
languages: ${{ matrix.language }}
queries: +security-and-quality

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

- name: Build (C++)
if: ${{ matrix.language == 'cpp' }}
run: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=100M
ccache -z

cmake --build build -j 4

ccache -s
du -hs ~/.cache/ccache

# Make sure CodeQL has something to do
touch Source/Utils/WarpXVersion.cpp
export CCACHE_DISABLE=1
cmake --build build -j 4

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
upload: False
output: sarif-results

- name: filter-sarif
uses: advanced-security/filter-sarif@v1
with:
Expand All @@ -111,7 +102,6 @@ jobs:
-build/_deps/*/*/*/*/*/*/*/*
input: sarif-results/${{ matrix.language }}.sarif
output: sarif-results/${{ matrix.language }}.sarif

- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
Expand Down
Loading