From 7f59e524093bcd26bde82ea0f0af91f8bf32d9b8 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 13:34:37 -0800 Subject: [PATCH 01/51] Add docs change to trigger CI --- Docs/source/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/source/index.rst b/Docs/source/index.rst index 9668620976a..8e9a56e3fd7 100644 --- a/Docs/source/index.rst +++ b/Docs/source/index.rst @@ -24,7 +24,7 @@ Contact us If you are starting using WarpX, or if you have a user question, please pop in our `discussions page `__ and get in touch with the community. -The `WarpX GitHub repo `__ is the main communication platform. +The `WarpX GitHub repository `__ is the main communication platform. Have a look at the action icons on the top right of the web page: feel free to watch the repo if you want to receive updates, or to star the repo to support the project. For bug reports or to request new features, you can also open a new `issue `__. From 0432f0a10314245b20a25d65efbeb8d28e480b72 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 13:38:52 -0800 Subject: [PATCH 02/51] Add workflow to check files changed --- .github/workflows/check_diff.yml | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/check_diff.yml diff --git a/.github/workflows/check_diff.yml b/.github/workflows/check_diff.yml new file mode 100644 index 00000000000..c4ef1c08fe8 --- /dev/null +++ b/.github/workflows/check_diff.yml @@ -0,0 +1,49 @@ +name: PR analysis + +on: + pull_request: + +concurrency: + group: ${{ github.ref }}-${{ github.head_ref }}-checkdiff + cancel-in-progress: true + +jobs: + check_diff: + name: Check files changed + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Define base and head refs + env: + BASE_REF: ${{ github.event.pull_request.base.ref }} + HEAD_REF: ${{ github.event.pull_request.head.ref }} + run: | + echo "Base ref: ${BASE_REF}" + echo "Head ref: ${HEAD_REF}" + - name: Add forked repository as remote + run: | + git remote add fork ${{ github.event.pull_request.head.repo.clone_url }} + - name: Fetch base branch from main repository + run: | + git fetch origin ${BASE_REF} + - name: Fetch head branch from forked repository + run: | + git fetch fork ${HEAD_REF} + - name: Get files changed + env: + BASE_REF: ${{ github.event.pull_request.base.ref }} + HEAD_REF: ${{ github.event.pull_request.head.ref }} + run: | + git diff --name-only --diff-filter=ACMRTUXB origin/${BASE_REF}..fork/${HEAD_REF} > check_diff.txt + - name: Check files changed + run: | + if grep -v -E "^(docs|\.github)/|\.azure-pipelines\.yml$" check_diff.txt; then + echo "skip=false" >> ${GITHUB_OUTPUT} + else + echo "skip=true" >> ${GITHUB_OUTPUT} + fi + outputs: + skip: ${{ steps.check.outputs.skip }} From 20250bbbf160eed74444ef8f207c3b5b3a9523a4 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 13:56:31 -0800 Subject: [PATCH 03/51] Debugging --- .github/workflows/check_diff.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check_diff.yml b/.github/workflows/check_diff.yml index c4ef1c08fe8..9905bff21d3 100644 --- a/.github/workflows/check_diff.yml +++ b/.github/workflows/check_diff.yml @@ -11,18 +11,14 @@ jobs: check_diff: name: Check files changed runs-on: ubuntu-20.04 + env: + BASE_REF: ${{ github.event.pull_request.base.ref }} + HEAD_REF: ${{ github.event.pull_request.head.ref }} steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Define base and head refs - env: - BASE_REF: ${{ github.event.pull_request.base.ref }} - HEAD_REF: ${{ github.event.pull_request.head.ref }} - run: | - echo "Base ref: ${BASE_REF}" - echo "Head ref: ${HEAD_REF}" - name: Add forked repository as remote run: | git remote add fork ${{ github.event.pull_request.head.repo.clone_url }} @@ -33,17 +29,17 @@ jobs: run: | git fetch fork ${HEAD_REF} - name: Get files changed - env: - BASE_REF: ${{ github.event.pull_request.base.ref }} - HEAD_REF: ${{ github.event.pull_request.head.ref }} run: | git diff --name-only --diff-filter=ACMRTUXB origin/${BASE_REF}..fork/${HEAD_REF} > check_diff.txt - name: Check files changed run: | - if grep -v -E "^(docs|\.github)/|\.azure-pipelines\.yml$" check_diff.txt; then + if grep -v -E "^(Docs|\.github)/|\.azure-pipelines\.yml$" check_diff.txt; then + echo "skip=false" echo "skip=false" >> ${GITHUB_OUTPUT} else + echo "skip=true" echo "skip=true" >> ${GITHUB_OUTPUT} fi + echo "GITHUB_OUTPUT = ${GITHUB_OUTPUT}" outputs: skip: ${{ steps.check.outputs.skip }} From bfda4615b117139783db0adb1da690a25d1f4533 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 14:27:45 -0800 Subject: [PATCH 04/51] Debugging: skip macOS workflow --- .github/workflows/macos.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0ddfcf38b41..2189bdaa791 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -4,9 +4,10 @@ on: push: branches: - "development" - pull_request: - paths-ignore: - - "Docs/**" + workflow_run: + workflows: [PR analysis] + types: + - completed concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-macos @@ -16,7 +17,8 @@ jobs: build_appleclang: name: AppleClang runs-on: macos-latest - if: github.event.pull_request.draft == false + #if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }} env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE # For macOS, Ninja is slower than the default: From 360b43d6683d8aab82b374278c08dec8939e1edc Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 14:30:12 -0800 Subject: [PATCH 05/51] Debugging: skip Azure workflows --- .azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index d22097a208f..72daa035fba 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -13,6 +13,8 @@ pr: paths: exclude: - Docs + - .github/workflows/** + - .azure-pipelines.yml jobs: - job: From ff66cf8cb168569c4de4b69082ee955c4a7e8db4 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 15:09:12 -0800 Subject: [PATCH 06/51] Debugging --- .github/workflows/macos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2189bdaa791..366daa47eca 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -17,8 +17,7 @@ jobs: build_appleclang: name: AppleClang runs-on: macos-latest - #if: github.event.pull_request.draft == false - if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }} + #if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }} env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE # For macOS, Ninja is slower than the default: From 6f7023fcdf9fa885b7e689a91f79f50ed291fe3f Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 15:31:41 -0800 Subject: [PATCH 07/51] Debugging: try reusable workflows --- .github/workflows/check_diff.yml | 4 + .github/workflows/macos.yml | 151 +++++++++++++++---------------- 2 files changed, 79 insertions(+), 76 deletions(-) diff --git a/.github/workflows/check_diff.yml b/.github/workflows/check_diff.yml index 9905bff21d3..ac78c637370 100644 --- a/.github/workflows/check_diff.yml +++ b/.github/workflows/check_diff.yml @@ -1,6 +1,9 @@ name: PR analysis on: + workflow_call: + outputs: + skip: { type: boolean, description: "Whether to skip dependent CI checks" } pull_request: concurrency: @@ -32,6 +35,7 @@ jobs: run: | git diff --name-only --diff-filter=ACMRTUXB origin/${BASE_REF}..fork/${HEAD_REF} > check_diff.txt - name: Check files changed + id: check run: | if grep -v -E "^(Docs|\.github)/|\.azure-pipelines\.yml$" check_diff.txt; then echo "skip=false" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 366daa47eca..2e7754f3054 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,13 +1,7 @@ name: 🍏 macOS on: - push: - branches: - - "development" - workflow_run: - workflows: [PR analysis] - types: - - completed + pull_request: concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-macos @@ -17,78 +11,83 @@ jobs: build_appleclang: name: AppleClang runs-on: macos-latest - #if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }} - env: - HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE - # For macOS, Ninja is slower than the default: - #CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - name: Install Python - with: - python-version: '3.x' - - name: install brew dependencies - run: | - set +e - brew unlink gcc - brew update - brew upgrade || true - brew install ccache - brew install fftw - brew install libomp - brew link --overwrite --force libomp - brew install ninja - brew install open-mpi - brew install pkg-config - set -e - brew tap openpmd/openpmd - brew install openpmd-api - - name: install pip dependencies - run: | - python3 -m pip install --upgrade pip - python3 -m pip install --upgrade build packaging setuptools wheel - python3 -m pip install --upgrade mpi4py - python3 -m pip install --upgrade -r Regression/requirements.txt - - name: CCache Cache - uses: actions/cache@v4 - with: - path: ~/Library/Caches/ccache - key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} - restore-keys: | - ccache-${{ github.workflow }}-${{ github.job }}-git- - - name: build WarpX - run: | - export CCACHE_COMPRESS=1 - export CCACHE_COMPRESSLEVEL=10 - export CCACHE_MAXSIZE=100M - export CCACHE_SLOPPINESS=time_macros - ccache -z + - name: Run PR analysis + uses: ./.github/workflows/pr-analysis.yml + id: pr_analysis + - name: Checkout code + if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} + uses: actions/checkout@v4 + - name: Install Python + if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install brew dependencies + if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} + run: | + set +e + brew unlink gcc + brew update + brew upgrade || true + brew install ccache + brew install fftw + brew install libomp + brew link --overwrite --force libomp + brew install ninja + brew install open-mpi + brew install pkg-config + set -e + brew tap openpmd/openpmd + brew install openpmd-api + - name: Install pip dependencies + if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} + run: | + python3 -m pip install --upgrade pip + python3 -m pip install --upgrade build packaging setuptools wheel + python3 -m pip install --upgrade mpi4py + python3 -m pip install --upgrade -r Regression/requirements.txt + - name: CCache Cache + if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} + uses: actions/cache@v4 + with: + path: ~/Library/Caches/ccache + key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} + restore-keys: | + ccache-${{ github.workflow }}-${{ github.job }}-git- + - name: Build WarpX + if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} + run: | + export CCACHE_COMPRESS=1 + export CCACHE_COMPRESSLEVEL=10 + export CCACHE_MAXSIZE=100M + export CCACHE_SLOPPINESS=time_macros + ccache -z - export CXXFLAGS="-Werror -Wno-error=pass-failed" + export CXXFLAGS="-Werror -Wno-error=pass-failed" - cmake -S . -B build_dp \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DWarpX_EB=OFF \ - -DWarpX_OPENPMD=ON \ - -DWarpX_openpmd_internal=OFF - cmake --build build_dp -j 3 + cmake -S . -B build_dp \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DWarpX_EB=OFF \ + -DWarpX_OPENPMD=ON \ + -DWarpX_openpmd_internal=OFF + cmake --build build_dp -j 3 - cmake -S . -B build_sp \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DWarpX_EB=OFF \ - -DWarpX_PYTHON=ON \ - -DWarpX_OPENPMD=ON \ - -DWarpX_openpmd_internal=OFF \ - -DWarpX_PRECISION=SINGLE - cmake --build build_sp -j 3 - cmake --build build_sp --target pip_install + cmake -S . -B build_sp \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DWarpX_EB=OFF \ + -DWarpX_PYTHON=ON \ + -DWarpX_OPENPMD=ON \ + -DWarpX_openpmd_internal=OFF \ + -DWarpX_PRECISION=SINGLE + cmake --build build_sp -j 3 + cmake --build build_sp --target pip_install - du -hs ~/Library/Caches/ccache - ccache -s + du -hs ~/Library/Caches/ccache + ccache -s + - name: Run pywarpx + if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} + run: | + export OMP_NUM_THREADS=1 - - name: run pywarpx - run: | - export OMP_NUM_THREADS=1 - - mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py + mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py From b7a8ffb6e5d8be2865ad265c7ccc6932c8769b66 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 17:21:49 -0800 Subject: [PATCH 08/51] Debugging: use separate bash script --- .github/workflows/check_diff.yml | 49 ------------------------- .github/workflows/macos.yml | 30 ++++++++++----- .github/workflows/scripts/check_diff.sh | 35 ++++++++++++++++++ 3 files changed, 55 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/check_diff.yml create mode 100755 .github/workflows/scripts/check_diff.sh diff --git a/.github/workflows/check_diff.yml b/.github/workflows/check_diff.yml deleted file mode 100644 index ac78c637370..00000000000 --- a/.github/workflows/check_diff.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: PR analysis - -on: - workflow_call: - outputs: - skip: { type: boolean, description: "Whether to skip dependent CI checks" } - pull_request: - -concurrency: - group: ${{ github.ref }}-${{ github.head_ref }}-checkdiff - cancel-in-progress: true - -jobs: - check_diff: - name: Check files changed - runs-on: ubuntu-20.04 - env: - BASE_REF: ${{ github.event.pull_request.base.ref }} - HEAD_REF: ${{ github.event.pull_request.head.ref }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Add forked repository as remote - run: | - git remote add fork ${{ github.event.pull_request.head.repo.clone_url }} - - name: Fetch base branch from main repository - run: | - git fetch origin ${BASE_REF} - - name: Fetch head branch from forked repository - run: | - git fetch fork ${HEAD_REF} - - name: Get files changed - run: | - git diff --name-only --diff-filter=ACMRTUXB origin/${BASE_REF}..fork/${HEAD_REF} > check_diff.txt - - name: Check files changed - id: check - run: | - if grep -v -E "^(Docs|\.github)/|\.azure-pipelines\.yml$" check_diff.txt; then - echo "skip=false" - echo "skip=false" >> ${GITHUB_OUTPUT} - else - echo "skip=true" - echo "skip=true" >> ${GITHUB_OUTPUT} - fi - echo "GITHUB_OUTPUT = ${GITHUB_OUTPUT}" - outputs: - skip: ${{ steps.check.outputs.skip }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2e7754f3054..6ebbba50b55 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -8,23 +8,37 @@ concurrency: cancel-in-progress: true jobs: + + skip_checks: + name: Skip checks? + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Run PR analysis script + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} + build_appleclang: name: AppleClang runs-on: macos-latest + needs: skip_checks + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} steps: - - name: Run PR analysis - uses: ./.github/workflows/pr-analysis.yml - id: pr_analysis - name: Checkout code - if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} uses: actions/checkout@v4 - name: Install Python - if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install brew dependencies - if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} run: | set +e brew unlink gcc @@ -41,14 +55,12 @@ jobs: brew tap openpmd/openpmd brew install openpmd-api - name: Install pip dependencies - if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} run: | python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel python3 -m pip install --upgrade mpi4py python3 -m pip install --upgrade -r Regression/requirements.txt - name: CCache Cache - if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} uses: actions/cache@v4 with: path: ~/Library/Caches/ccache @@ -56,7 +68,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -86,7 +97,6 @@ jobs: du -hs ~/Library/Caches/ccache ccache -s - name: Run pywarpx - if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }} run: | export OMP_NUM_THREADS=1 diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh new file mode 100755 index 00000000000..32af0fa8d6d --- /dev/null +++ b/.github/workflows/scripts/check_diff.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -o nounset +set -o errexit +set -o pipefail + +# Parse command line arguments +head_ref=${1} +base_ref=${2} +clone_url=${3} + +# Set paths to ignore +paths_ignore="^(Docs|\.github)/|\.azure-pipelines\.yml$" + +# Add forked repository as remote +git remote add fork ${clone_url} + +# Fetch base branch from main repository +git fetch origin ${base_ref} + +# Fetch head branch from forked repository +git fetch fork ${head_ref} + +# Save output of git diff to inspect files changed +git diff --name-only --diff-filter=ACMRTUXB origin/${base_ref}..fork/${head_ref} > check_diff.txt + +# Set skip variable after inspecting files changed +skip=$(grep -v -E "${paths_ignore}" check_diff.txt) + +# Set an environment variable based on the output +if [ -z "$skip" ]; then + echo "SKIP_CHECKS=true" >> $GITHUB_ENV +else + echo "SKIP_CHECKS=false" >> $GITHUB_ENV +fi From f8d50363f1b75997be15ff42584e6b2ce399c5fb Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 21:14:55 -0800 Subject: [PATCH 09/51] Debugging --- .github/workflows/scripts/check_diff.sh | 27 ++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 32af0fa8d6d..63c78cc9800 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -3,6 +3,7 @@ set -o nounset set -o errexit set -o pipefail +set -o xtrace # Parse command line arguments head_ref=${1} @@ -12,8 +13,11 @@ clone_url=${3} # Set paths to ignore paths_ignore="^(Docs|\.github)/|\.azure-pipelines\.yml$" -# Add forked repository as remote -git remote add fork ${clone_url} +# Check if remote repository already exists +if ! git remote --get-url fork > /dev/null 2>&1; then + # Add forked repository as remote + git remote add fork ${clone_url} +fi # Fetch base branch from main repository git fetch origin ${base_ref} @@ -24,12 +28,17 @@ git fetch fork ${head_ref} # Save output of git diff to inspect files changed git diff --name-only --diff-filter=ACMRTUXB origin/${base_ref}..fork/${head_ref} > check_diff.txt -# Set skip variable after inspecting files changed -skip=$(grep -v -E "${paths_ignore}" check_diff.txt) - -# Set an environment variable based on the output -if [ -z "$skip" ]; then - echo "SKIP_CHECKS=true" >> $GITHUB_ENV +# Check if check_diff.txt is not empty +if [ -s check_diff.txt ]; then + # Set skip variable after inspecting files changed + skip=$(grep -v -E "${paths_ignore}" check_diff.txt) + # Set an environment variable based on the output + if [ -z "$skip" ]; then + echo "SKIP_CHECKS=true" >> $GITHUB_ENV + else + echo "SKIP_CHECKS=false" >> $GITHUB_ENV + fi else - echo "SKIP_CHECKS=false" >> $GITHUB_ENV + # If check_diff.txt is empty, set SKIP_CHECKS to true + echo "SKIP_CHECKS=true" >> $GITHUB_ENV fi From a443348d1a1a32976841e9623b0223b7bc54d38c Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Mon, 18 Nov 2024 21:34:31 -0800 Subject: [PATCH 10/51] Debugging from scratch --- .github/workflows/scripts/check_diff.sh | 27 +++++++++---------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 63c78cc9800..32af0fa8d6d 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -3,7 +3,6 @@ set -o nounset set -o errexit set -o pipefail -set -o xtrace # Parse command line arguments head_ref=${1} @@ -13,11 +12,8 @@ clone_url=${3} # Set paths to ignore paths_ignore="^(Docs|\.github)/|\.azure-pipelines\.yml$" -# Check if remote repository already exists -if ! git remote --get-url fork > /dev/null 2>&1; then - # Add forked repository as remote - git remote add fork ${clone_url} -fi +# Add forked repository as remote +git remote add fork ${clone_url} # Fetch base branch from main repository git fetch origin ${base_ref} @@ -28,17 +24,12 @@ git fetch fork ${head_ref} # Save output of git diff to inspect files changed git diff --name-only --diff-filter=ACMRTUXB origin/${base_ref}..fork/${head_ref} > check_diff.txt -# Check if check_diff.txt is not empty -if [ -s check_diff.txt ]; then - # Set skip variable after inspecting files changed - skip=$(grep -v -E "${paths_ignore}" check_diff.txt) - # Set an environment variable based on the output - if [ -z "$skip" ]; then - echo "SKIP_CHECKS=true" >> $GITHUB_ENV - else - echo "SKIP_CHECKS=false" >> $GITHUB_ENV - fi -else - # If check_diff.txt is empty, set SKIP_CHECKS to true +# Set skip variable after inspecting files changed +skip=$(grep -v -E "${paths_ignore}" check_diff.txt) + +# Set an environment variable based on the output +if [ -z "$skip" ]; then echo "SKIP_CHECKS=true" >> $GITHUB_ENV +else + echo "SKIP_CHECKS=false" >> $GITHUB_ENV fi From 80205294529f655476cbd7f8b5fa83aa41aabb93 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 09:11:00 -0800 Subject: [PATCH 11/51] Debugging --- .github/workflows/macos.yml | 141 ++++++++++++------------ .github/workflows/scripts/check_diff.sh | 20 ++-- 2 files changed, 84 insertions(+), 77 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6ebbba50b55..4bb124d611f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,9 @@ name: 🍏 macOS on: + push: + branches: + - "development" pull_request: concurrency: @@ -17,7 +20,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Run PR analysis script + - name: Run PR analysis run: | .github/workflows/scripts/check_diff.sh \ ${{ github.event.pull_request.head.ref }} \ @@ -31,73 +34,71 @@ jobs: runs-on: macos-latest needs: skip_checks if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + env: + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE + # For macOS, Ninja is slower than the default: + #CMAKE_GENERATOR: Ninja steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install brew dependencies - run: | - set +e - brew unlink gcc - brew update - brew upgrade || true - brew install ccache - brew install fftw - brew install libomp - brew link --overwrite --force libomp - brew install ninja - brew install open-mpi - brew install pkg-config - set -e - brew tap openpmd/openpmd - brew install openpmd-api - - name: Install pip dependencies - run: | - python3 -m pip install --upgrade pip - python3 -m pip install --upgrade build packaging setuptools wheel - python3 -m pip install --upgrade mpi4py - python3 -m pip install --upgrade -r Regression/requirements.txt - - name: CCache Cache - uses: actions/cache@v4 - with: - path: ~/Library/Caches/ccache - key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} - restore-keys: | - ccache-${{ github.workflow }}-${{ github.job }}-git- - - name: Build WarpX - run: | - export CCACHE_COMPRESS=1 - export CCACHE_COMPRESSLEVEL=10 - export CCACHE_MAXSIZE=100M - export CCACHE_SLOPPINESS=time_macros - ccache -z - - export CXXFLAGS="-Werror -Wno-error=pass-failed" - - cmake -S . -B build_dp \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DWarpX_EB=OFF \ - -DWarpX_OPENPMD=ON \ - -DWarpX_openpmd_internal=OFF - cmake --build build_dp -j 3 - - cmake -S . -B build_sp \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DWarpX_EB=OFF \ - -DWarpX_PYTHON=ON \ - -DWarpX_OPENPMD=ON \ - -DWarpX_openpmd_internal=OFF \ - -DWarpX_PRECISION=SINGLE - cmake --build build_sp -j 3 - cmake --build build_sp --target pip_install - - du -hs ~/Library/Caches/ccache - ccache -s - - name: Run pywarpx - run: | - export OMP_NUM_THREADS=1 - - mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + name: Install Python + with: + python-version: '3.x' + - name: install brew dependencies + run: | + set +e + brew unlink gcc + brew update + brew upgrade || true + brew install ccache + brew install fftw + brew install libomp + brew link --overwrite --force libomp + brew install ninja + brew install open-mpi + brew install pkg-config + set -e + brew tap openpmd/openpmd + brew install openpmd-api + - name: install pip dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install --upgrade build packaging setuptools wheel + python3 -m pip install --upgrade mpi4py + python3 -m pip install --upgrade -r Regression/requirements.txt + - name: CCache Cache + uses: actions/cache@v4 + with: + path: ~/Library/Caches/ccache + key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} + restore-keys: | + ccache-${{ github.workflow }}-${{ github.job }}-git- + - name: build WarpX + run: | + export CCACHE_COMPRESS=1 + export CCACHE_COMPRESSLEVEL=10 + export CCACHE_MAXSIZE=100M + export CCACHE_SLOPPINESS=time_macros + ccache -z + export CXXFLAGS="-Werror -Wno-error=pass-failed" + cmake -S . -B build_dp \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DWarpX_EB=OFF \ + -DWarpX_OPENPMD=ON \ + -DWarpX_openpmd_internal=OFF + cmake --build build_dp -j 3 + cmake -S . -B build_sp \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DWarpX_EB=OFF \ + -DWarpX_PYTHON=ON \ + -DWarpX_OPENPMD=ON \ + -DWarpX_openpmd_internal=OFF \ + -DWarpX_PRECISION=SINGLE + cmake --build build_sp -j 3 + cmake --build build_sp --target pip_install + du -hs ~/Library/Caches/ccache + ccache -s + - name: run pywarpx + run: | + export OMP_NUM_THREADS=1 + mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 32af0fa8d6d..3d7fcb15527 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -3,15 +3,13 @@ set -o nounset set -o errexit set -o pipefail +set -o xtrace # Parse command line arguments head_ref=${1} base_ref=${2} clone_url=${3} -# Set paths to ignore -paths_ignore="^(Docs|\.github)/|\.azure-pipelines\.yml$" - # Add forked repository as remote git remote add fork ${clone_url} @@ -23,12 +21,20 @@ git fetch fork ${head_ref} # Save output of git diff to inspect files changed git diff --name-only --diff-filter=ACMRTUXB origin/${base_ref}..fork/${head_ref} > check_diff.txt +echo "Files changed:" +cat check_diff.txt -# Set skip variable after inspecting files changed -skip=$(grep -v -E "${paths_ignore}" check_diff.txt) +# Set paths to ignore +paths_ignore=() +paths_ignore+=("Docs/") +paths_ignore+=(".github/") +paths_ignore+=(".azure-pipelines.yml") + +# Set string for grep command +paths_ignore_string=$(IFS='|'; echo "${paths_ignore[*]}") -# Set an environment variable based on the output -if [ -z "$skip" ]; then +# Set skip variable after inspecting files changed +if ! grep -qEv "^(${paths_ignore_string})" check_diff.txt; then echo "SKIP_CHECKS=true" >> $GITHUB_ENV else echo "SKIP_CHECKS=false" >> $GITHUB_ENV From 07f752f519446503177fccdb0522d619525f7c3e Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:03:38 -0800 Subject: [PATCH 12/51] Clean up bash script --- .github/workflows/scripts/check_diff.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 3d7fcb15527..99f8bce0e26 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -3,7 +3,6 @@ set -o nounset set -o errexit set -o pipefail -set -o xtrace # Parse command line arguments head_ref=${1} @@ -29,13 +28,16 @@ paths_ignore=() paths_ignore+=("Docs/") paths_ignore+=(".github/") paths_ignore+=(".azure-pipelines.yml") +echo "Paths to ignore:" +echo ${paths_ignore} # Set string for grep command paths_ignore_string=$(IFS='|'; echo "${paths_ignore[*]}") # Set skip variable after inspecting files changed if ! grep -qEv "^(${paths_ignore_string})" check_diff.txt; then - echo "SKIP_CHECKS=true" >> $GITHUB_ENV + echo "SKIP_CHECKS=true" >> ${GITHUB_ENV} else - echo "SKIP_CHECKS=false" >> $GITHUB_ENV + echo "SKIP_CHECKS=false" >> ${GITHUB_ENV} fi +echo "GITHUB_ENV = ${GITHUB_ENV}" From 616e07c8ade052702f50e5fcae83148558087c5f Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:07:28 -0800 Subject: [PATCH 13/51] Clean up bash script --- .github/workflows/scripts/check_diff.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 99f8bce0e26..464607f8305 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -29,15 +29,16 @@ paths_ignore+=("Docs/") paths_ignore+=(".github/") paths_ignore+=(".azure-pipelines.yml") echo "Paths to ignore:" -echo ${paths_ignore} +echo ${paths_ignore[@]} # Set string for grep command paths_ignore_string=$(IFS='|'; echo "${paths_ignore[*]}") # Set skip variable after inspecting files changed if ! grep -qEv "^(${paths_ignore_string})" check_diff.txt; then + echo "Skip checks" echo "SKIP_CHECKS=true" >> ${GITHUB_ENV} else + echo "Run checks" echo "SKIP_CHECKS=false" >> ${GITHUB_ENV} fi -echo "GITHUB_ENV = ${GITHUB_ENV}" From 33520edd73fac29fa4ab3dd1cfa8833674783fd2 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:11:44 -0800 Subject: [PATCH 14/51] Clean up bash script --- .github/workflows/scripts/check_diff.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 464607f8305..15342e5a4c8 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -10,12 +10,10 @@ base_ref=${2} clone_url=${3} # Add forked repository as remote -git remote add fork ${clone_url} - # Fetch base branch from main repository -git fetch origin ${base_ref} - # Fetch head branch from forked repository +git remote add fork ${clone_url} +git fetch origin ${base_ref} git fetch fork ${head_ref} # Save output of git diff to inspect files changed From 822c7195b2a10ba92d75d211f95f86c703286bf2 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:16:05 -0800 Subject: [PATCH 15/51] Use shared YAML file --- .github/workflows/macos.yml | 34 +++++++++++++++---------------- .github/workflows/skip_checks.yml | 19 +++++++++++++++++ 2 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/skip_checks.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4bb124d611f..afd26818a34 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,24 +11,24 @@ concurrency: cancel-in-progress: true jobs: - + #skip_checks: + # name: Skip checks? + # runs-on: macos-latest + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # - name: Run PR analysis + # run: | + # .github/workflows/scripts/check_diff.sh \ + # ${{ github.event.pull_request.head.ref }} \ + # ${{ github.event.pull_request.base.ref }} \ + # ${{ github.event.pull_request.head.repo.clone_url }} + # outputs: + # skip: ${{ env.SKIP_CHECKS }} skip_checks: - name: Skip checks? - runs-on: macos-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Run PR analysis - run: | - .github/workflows/scripts/check_diff.sh \ - ${{ github.event.pull_request.head.ref }} \ - ${{ github.event.pull_request.base.ref }} \ - ${{ github.event.pull_request.head.repo.clone_url }} - outputs: - skip: ${{ env.SKIP_CHECKS }} - + uses: ./.github/workflows/skip_checks.yml build_appleclang: name: AppleClang runs-on: macos-latest diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml new file mode 100644 index 00000000000..ed6370039d3 --- /dev/null +++ b/.github/workflows/skip_checks.yml @@ -0,0 +1,19 @@ +name: Skip checks +on: + workflow_call: +jobs: + skip_checks: + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Run PR analysis + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} From f456176b0b403e6681e1a135ea6098f26c9702c9 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:31:51 -0800 Subject: [PATCH 16/51] Fix shared YAML file --- .github/workflows/skip_checks.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index ed6370039d3..dd91ffa8d18 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -1,6 +1,8 @@ name: Skip checks on: workflow_call: + outputs: + skip: ${{ jobs.skip_checks.outputs.skip }} jobs: skip_checks: runs-on: macos-latest From 4f79b767ef0e922b3bc970aee3d947a9755cdc16 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:35:05 -0800 Subject: [PATCH 17/51] Debugging shared YAML file --- .github/workflows/macos.yml | 2 +- .github/workflows/skip_checks.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index afd26818a34..240aaae0f12 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -33,7 +33,7 @@ jobs: name: AppleClang runs-on: macos-latest needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE # For macOS, Ninja is slower than the default: diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index dd91ffa8d18..ed6370039d3 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -1,8 +1,6 @@ name: Skip checks on: workflow_call: - outputs: - skip: ${{ jobs.skip_checks.outputs.skip }} jobs: skip_checks: runs-on: macos-latest From 6d010723cae3e69438c93ef145b13048876c2c11 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:39:46 -0800 Subject: [PATCH 18/51] Clean up workflow files --- .github/workflows/macos.yml | 41 +++++++++++++++---------------------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 240aaae0f12..fb5abb40e76 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,40 +11,29 @@ concurrency: cancel-in-progress: true jobs: - #skip_checks: - # name: Skip checks? - # runs-on: macos-latest - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # - name: Run PR analysis - # run: | - # .github/workflows/scripts/check_diff.sh \ - # ${{ github.event.pull_request.head.ref }} \ - # ${{ github.event.pull_request.base.ref }} \ - # ${{ github.event.pull_request.head.repo.clone_url }} - # outputs: - # skip: ${{ env.SKIP_CHECKS }} skip_checks: + name: Skip checks? uses: ./.github/workflows/skip_checks.yml build_appleclang: name: AppleClang runs-on: macos-latest needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: github.event.pull_request.draft == false env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE # For macOS, Ninja is slower than the default: #CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - name: Install Python + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install Python + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/setup-python@v5 with: python-version: '3.x' - - name: install brew dependencies + - name: Install brew dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | set +e brew unlink gcc @@ -60,20 +49,23 @@ jobs: set -e brew tap openpmd/openpmd brew install openpmd-api - - name: install pip dependencies + - name: Install pip dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel python3 -m pip install --upgrade mpi4py python3 -m pip install --upgrade -r Regression/requirements.txt - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/Library/Caches/ccache key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - - name: build WarpX + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -98,7 +90,8 @@ jobs: cmake --build build_sp --target pip_install du -hs ~/Library/Caches/ccache ccache -s - - name: run pywarpx + - name: Run pywarpx + if: needs.skip_checks.outputs.skip == 'false' run: | export OMP_NUM_THREADS=1 mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py From 8cdcfc9cbc5a88a19423ff75b63900ac2617ac18 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:44:08 -0800 Subject: [PATCH 19/51] Clean up workflow files --- .github/workflows/macos.yml | 2 +- .github/workflows/skip_checks.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index fb5abb40e76..ae188577979 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,7 +12,7 @@ concurrency: jobs: skip_checks: - name: Skip checks? + name: Analyze PR uses: ./.github/workflows/skip_checks.yml build_appleclang: name: AppleClang diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index ed6370039d3..7c61607aff7 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -3,6 +3,7 @@ on: workflow_call: jobs: skip_checks: + name: Skip checks? runs-on: macos-latest steps: - name: Checkout code From b1dacec1e47513dd38dcec5fd163cdd3b7f2cd28 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:46:45 -0800 Subject: [PATCH 20/51] Clean up workflow files --- .github/workflows/skip_checks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index 7c61607aff7..39833810001 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -1,4 +1,3 @@ -name: Skip checks on: workflow_call: jobs: From 8628ce15be0daffc11611d3c4d925446385e1546 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:48:53 -0800 Subject: [PATCH 21/51] Clean up workflow files --- .github/workflows/macos.yml | 2 +- .github/workflows/skip_checks.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ae188577979..1061ee80150 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,7 +12,7 @@ concurrency: jobs: skip_checks: - name: Analyze PR + name: analyze uses: ./.github/workflows/skip_checks.yml build_appleclang: name: AppleClang diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index 39833810001..1a8cedebfb6 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -2,7 +2,7 @@ on: workflow_call: jobs: skip_checks: - name: Skip checks? + name: skip? runs-on: macos-latest steps: - name: Checkout code From 69b89022f9410f50be707fb1f29093124f1ff09d Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:50:52 -0800 Subject: [PATCH 22/51] Clean up workflow files --- .github/workflows/macos.yml | 2 +- .github/workflows/skip_checks.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1061ee80150..4519df5f7e7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,7 +12,7 @@ concurrency: jobs: skip_checks: - name: analyze + name: Analyze uses: ./.github/workflows/skip_checks.yml build_appleclang: name: AppleClang diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index 1a8cedebfb6..b0aba375535 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -2,14 +2,14 @@ on: workflow_call: jobs: skip_checks: - name: skip? + name: Skip runs-on: macos-latest steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Run PR analysis + - name: Analyze PR run: | .github/workflows/scripts/check_diff.sh \ ${{ github.event.pull_request.head.ref }} \ From f7bb79e9def6e8663ae596216533a14b39eaa83d Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:56:50 -0800 Subject: [PATCH 23/51] Pass `runs-on` as input --- .github/workflows/macos.yml | 2 ++ .github/workflows/skip_checks.yml | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4519df5f7e7..4974e1e5931 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,6 +14,8 @@ jobs: skip_checks: name: Analyze uses: ./.github/workflows/skip_checks.yml + with: + runs-on: macos-latest build_appleclang: name: AppleClang runs-on: macos-latest diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index b0aba375535..447b373d34c 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -1,9 +1,13 @@ on: workflow_call: + inputs: + runs-on: + description: "Type of machine to run on" + required: true jobs: skip_checks: name: Skip - runs-on: macos-latest + runs-on: ${{ inputs.runs-on }} steps: - name: Checkout code uses: actions/checkout@v4 From 4754962d7450f7eaf9ae119333edfacc5a53c9f1 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 10:59:16 -0800 Subject: [PATCH 24/51] Add missing `type` parameter --- .github/workflows/skip_checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index 447b373d34c..e3bf538ee25 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -4,6 +4,7 @@ on: runs-on: description: "Type of machine to run on" required: true + type: string jobs: skip_checks: name: Skip From b185fccad37c0823822f5c6e303267604a6c0012 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:06:22 -0800 Subject: [PATCH 25/51] Update ubuntu workflow --- .github/workflows/ubuntu.yml | 94 +++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index bbe20679781..d9de7c5ca72 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -5,39 +5,47 @@ on: branches: - "development" pull_request: - paths-ignore: - - "Docs/**" concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-ubuntu cancel-in-progress: true jobs: + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: ubuntu-20.04 build_cxxminimal: name: GCC Minimal w/o MPI runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CXXFLAGS: "-Werror" steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/gcc.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=100M ccache -z - cmake -S . -B build \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_DIMS="RZ;3" \ @@ -47,37 +55,40 @@ jobs: cmake --build build -j 4 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz - ccache -s du -hs ~/.cache/ccache - build_1D_2D: name: GCC 1D & 2D w/ MPI, QED tools runs-on: ubuntu-22.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CXXFLAGS: "-Werror" CXX: "g++-12" CC: "gcc-12" steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/gcc12.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=100M ccache -z - cmake -S . -B build \ -GNinja \ -DCMAKE_VERBOSE_MAKEFILE=ON \ @@ -86,48 +97,49 @@ jobs: -DWarpX_FFT=ON \ -DWarpX_QED_TABLE_GEN=ON \ -DWarpX_QED_TOOLS=ON - cmake --build build -j 4 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_base_1d ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_base_2d - ccache -s du -hs ~/.cache/ccache - - - name: run QED table tools + - name: Run QED table tools + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/scripts/checkQEDTableGenerator.sh - build_3D_sp: name: GCC 3D & RZ w/ MPI, single precision runs-on: ubuntu-22.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CXX: "g++-12" CC: "gcc-12" steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/gcc12_blaspp_lapackpp.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=200M ccache -z - # we need to define this *after* having installed the dependencies, # because the compilation of blaspp raises warnings. export CXXFLAGS="-Werror" - cmake -S . -B build \ -GNinja \ -DCMAKE_VERBOSE_MAKEFILE=ON \ @@ -137,53 +149,54 @@ jobs: -DWarpX_PRECISION=SINGLE \ -DWarpX_PARTICLE_PRECISION=SINGLE \ -DWarpX_QED_TABLE_GEN=ON - cmake --build build -j 4 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz - ccache -s du -hs ~/.cache/ccache - build_gcc_ablastr: name: GCC ABLASTR w/o MPI runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CMAKE_GENERATOR: Ninja CXXFLAGS: "-Werror" steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/gcc.sh sudo apt-get install -y libopenmpi-dev openmpi-bin - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=100M ccache -z - cmake -S . -B build \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_APP=OFF \ -DWarpX_LIB=OFF cmake --build build -j 4 - ccache -s du -hs ~/.cache/ccache - build_pyfull: name: Clang pywarpx runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CC: clang @@ -191,40 +204,41 @@ jobs: # On CI for this test, Ninja is slower than the default: #CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/pyfull.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=100M ccache -z - python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel - export CXXFLAGS="-Werror -Wno-error=pass-failed" - cmake -S . -B build \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_FFT=ON \ -DWarpX_PYTHON=ON \ -DWarpX_QED_TABLE_GEN=ON cmake --build build -j 4 --target pip_install - ccache -s du -hs ~/.cache/ccache - - - name: run pywarpx + - name: Run pywarpx + if: needs.skip_checks.outputs.skip == 'false' run: | export OMP_NUM_THREADS=1 mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py From 3394214bb4f9951611658d8f189b645b24059cc2 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:15:56 -0800 Subject: [PATCH 26/51] Update clang sanitizers workflow --- .github/workflows/clang_sanitizers.yml | 56 ++++++++++++-------------- .github/workflows/ubuntu.yml | 2 +- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index e89cb676a03..3dc634069d9 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -5,18 +5,22 @@ on: branches: - "development" pull_request: - paths-ignore: - - "Docs/**" concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-clangsanitizers cancel-in-progress: true jobs: + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: ubuntu-latest build_UB_sanitizer: name: Clang UB sanitizer runs-on: ubuntu-22.04 container: ubuntu:23.10 + needs: skip_checks if: github.event.pull_request.draft == false env: CC: clang @@ -24,28 +28,31 @@ jobs: # On CI for this test, Ninja is slower than the default: #CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/clang17.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=100M ccache -z - export CXX=$(which clang++-17) export CC=$(which clang-17) export CXXFLAGS="-fsanitize=undefined,address,pointer-compare -fno-sanitize-recover=all" - cmake -S . -B build \ -GNinja \ -DCMAKE_VERBOSE_MAKEFILE=ON \ @@ -58,27 +65,21 @@ jobs: -DWarpX_PRECISION=SINGLE \ -DWarpX_PARTICLE_PRECISION=SINGLE cmake --build build -j 4 - ccache -s du -hs ~/.cache/ccache - - - name: run with UB sanitizer + - name: Run with UB sanitizer + if: needs.skip_checks.outputs.skip == 'false' run: | - # We need these two lines because these tests run inside a docker container export OMPI_ALLOW_RUN_AS_ROOT=1 export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - export OMP_NUM_THREADS=2 - #MPI implementations often leak memory export "ASAN_OPTIONS=detect_leaks=0" - mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_base_1d mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_base_2d mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d - build_thread_sanitizer: name: Clang thread sanitizer runs-on: ubuntu-22.04 @@ -90,28 +91,31 @@ jobs: # On CI for this test, Ninja is slower than the default: #CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/clang17.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=100M ccache -z - export CXX=$(which clang++-17) export CC=$(which clang-17) export CXXFLAGS="-fsanitize=thread" - cmake -S . -B build \ -GNinja \ -DCMAKE_VERBOSE_MAKEFILE=ON \ @@ -125,7 +129,6 @@ jobs: -DWarpX_PRECISION=DOUBLE \ -DWarpX_PARTICLE_PRECISION=DOUBLE cmake --build build -j 4 - cmake -S . -B build_EB \ -GNinja \ -DCMAKE_VERBOSE_MAKEFILE=ON \ @@ -139,30 +142,23 @@ jobs: -DWarpX_PRECISION=DOUBLE \ -DWarpX_PARTICLE_PRECISION=DOUBLE cmake --build build_EB -j 4 - ccache -s du -hs ~/.cache/ccache - - - name: run with thread sanitizer + - name: Run with thread sanitizer + if: needs.skip_checks.outputs.skip == 'false' run: | export PMIX_MCA_gds=hash export TSAN_OPTIONS='ignore_noninstrumented_modules=1' export ARCHER_OPTIONS="verbose=1" - # We need these two lines because these tests run inside a docker container export OMPI_ALLOW_RUN_AS_ROOT=1 export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - export OMP_NUM_THREADS=2 - mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz warpx.serialize_initial_conditions = 0 mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_base_1d warpx.serialize_initial_conditions = 0 mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_base_2d warpx.serialize_initial_conditions = 0 mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d warpx.serialize_initial_conditions = 0 - git clone https://github.com/ECP-WarpX/warpx-data ../warpx-data cd Examples/Tests/embedded_circle - ulimit -c unlimited - mpirun -n 2 ../../../build_EB/bin/warpx.2d inputs_test_2d_embedded_circle warpx.serialize_initial_conditions = 0 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d9de7c5ca72..5b2e9cef363 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -15,7 +15,7 @@ jobs: name: Analyze uses: ./.github/workflows/skip_checks.yml with: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest build_cxxminimal: name: GCC Minimal w/o MPI runs-on: ubuntu-20.04 From 96e5527021fbee517a4c7c39004df44b2a973273 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:16:50 -0800 Subject: [PATCH 27/51] Fix clang sanitizers workflow --- .github/workflows/clang_sanitizers.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 3dc634069d9..506f81d08e2 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -84,6 +84,7 @@ jobs: name: Clang thread sanitizer runs-on: ubuntu-22.04 container: ubuntu:23.10 + needs: skip_checks if: github.event.pull_request.draft == false env: CC: clang From bdf2fe07a3dea7923450bd738e710317ab5e6347 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:20:06 -0800 Subject: [PATCH 28/51] Update clang tidy workflow --- .github/workflows/clang_tidy.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index edb3e8b1988..716c5da4821 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -5,14 +5,17 @@ on: branches: - "development" pull_request: - paths-ignore: - - "Docs/**" concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-clangtidy cancel-in-progress: true jobs: + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: ubuntu-latest run_clang_tidy: strategy: matrix: @@ -20,20 +23,26 @@ jobs: name: clang-tidy-${{ matrix.dim }}D runs-on: ubuntu-22.04 timeout-minutes: 180 + needs: skip_checks if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/clang15.sh - - name: set up cache + - name: Set up cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX & run clang-tidy + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -41,10 +50,8 @@ jobs: export CCACHE_EXTRAFILES=${{ github.workspace }}/.clang-tidy export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt ccache -z - export CXX=$(which clang++-15) export CC=$(which clang-15) - cmake -S . -B build_clang_tidy \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_DIMS="${{ matrix.dim }}" \ @@ -56,13 +63,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-15 \ CLANG_TIDY_ARGS="--config-file=${{github.workspace}}/.clang-tidy --warnings-as-errors=*" - ccache -s du -hs ~/.cache/ccache From ea76676b4bb954b27f08e9fc4843bb64b5bac466 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:27:15 -0800 Subject: [PATCH 29/51] Update code quality workflow --- .github/workflows/codeql.yml | 44 ++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e3549ae340a..163c57697d5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,92 +13,88 @@ concurrency: cancel-in-progress: true jobs: + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: ubuntu-latest analyze: name: Analyze runs-on: ubuntu-latest + needs: skip_checks if: github.event.pull_request.draft == false permissions: actions: read contents: read security-events: write - strategy: fail-fast: false matrix: language: [ python, cpp ] - steps: - - name: Checkout + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - name: Install Python + - name: Install Python + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/setup-python@v5 with: python-version: '3.x' - - name: Install Packages (C++) - if: ${{ matrix.language == 'cpp' }} + if: ${{ needs.skip_checks.outputs.skip == 'false' && 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' }} + if: ${{ needs.skip_checks.outputs.skip == 'false' && matrix.language == 'cpp' }} 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: Configure (C++) - if: ${{ matrix.language == 'cpp' }} + if: ${{ needs.skip_checks.outputs.skip == 'false' && matrix.language == 'cpp' }} run: | cmake -S . -B build -DWarpX_OPENPMD=ON - - name: Initialize CodeQL + if: needs.skip_checks.outputs.skip == 'false' uses: github/codeql-action/init@v3 with: config-file: ./.github/codeql/warpx-codeql.yml languages: ${{ matrix.language }} queries: +security-and-quality - - name: Build (py) + if: ${{ needs.skip_checks.outputs.skip == 'false' && matrix.language == 'python' }} uses: github/codeql-action/autobuild@v3 - if: ${{ matrix.language == 'python' }} - - name: Build (C++) - if: ${{ matrix.language == 'cpp' }} + if: ${{ needs.skip_checks.outputs.skip == 'false' && 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 + if: needs.skip_checks.outputs.skip == 'false' uses: github/codeql-action/analyze@v3 with: category: "/language:${{ matrix.language }}" upload: False output: sarif-results - - name: filter-sarif + if: needs.skip_checks.outputs.skip == 'false' uses: advanced-security/filter-sarif@v1 with: patterns: | @@ -111,8 +107,8 @@ jobs: -build/_deps/*/*/*/*/*/*/*/* input: sarif-results/${{ matrix.language }}.sarif output: sarif-results/${{ matrix.language }}.sarif - - name: Upload SARIF + if: needs.skip_checks.outputs.skip == 'false' uses: github/codeql-action/upload-sarif@v3 with: sarif_file: sarif-results/${{ matrix.language }}.sarif From 6a6c48c888e54d9931122f75d3d720bc19668b2f Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:34:05 -0800 Subject: [PATCH 30/51] Update cuda workflow --- .github/workflows/cuda.yml | 65 ++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 8d40aba553c..2ccb6285b2d 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -5,8 +5,6 @@ on: branches: - "development" pull_request: - paths-ignore: - - "Docs/**" concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-cuda @@ -17,43 +15,52 @@ jobs: # https://gitlab.com/nvidia/container-images/cuda/-/blob/master/dist/ubuntu18.04/10.1/base/Dockerfile # https://github.com/ComputationalRadiationPhysics/picongpu/blob/0.5.0/share/picongpu/dockerfiles/ubuntu-1604/Dockerfile # https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: ubuntu-latest build_nvcc: name: NVCC 11.3 SP runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CXXFLAGS: "-Werror" CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - name: Install Python + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install Python + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/setup-python@v5 with: python-version: '3.x' - - name: install dependencies + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/nvcc11-3.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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: install openPMD-api + - name: Install openPMD-api + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=600M ccache -z - export CEI_SUDO="sudo" export CEI_TMP="/tmp/cei" - export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH} which nvcc || echo "nvcc not in PATH!" - cmake-easyinstall --prefix=/usr/local \ git+https://github.com/openPMD/openPMD-api.git@0.15.1 \ -DopenPMD_USE_PYTHON=OFF \ @@ -62,16 +69,15 @@ jobs: -DBUILD_CLI_TOOLS=OFF \ -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \ -DCMAKE_VERBOSE_MAKEFILE=ON - - name: build WarpX + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=600M - export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH} which nvcc || echo "nvcc not in PATH!" - cmake -S . -B build_sp \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_COMPUTE=CUDA \ @@ -85,65 +91,69 @@ jobs: -DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON \ -DAMReX_CUDA_ERROR_CAPTURE_THIS=ON cmake --build build_sp -j 4 - python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel export WARPX_MPI=ON export PYWARPX_LIB_DIR=$PWD/build_sp/lib/site-packages/pywarpx/ python3 -m pip wheel . python3 -m pip install *.whl - ccache -s du -hs ~/.cache/ccache - # make sure legacy build system continues to build, i.e., that we don't forget # to add new .cpp files build_nvcc_gnumake: name: NVCC 11.8.0 GNUmake runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/nvcc11-8.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=600M ccache -z - export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH} which nvcc || echo "nvcc not in PATH!" - git clone https://github.com/AMReX-Codes/amrex.git ../amrex cd ../amrex && git checkout --detach 456c93c7d9512f1cdffac0574973d7df41417898 && cd - make COMP=gcc QED=FALSE USE_MPI=TRUE USE_GPU=TRUE USE_OMP=FALSE USE_FFT=TRUE USE_CCACHE=TRUE -j 4 - ccache -s du -hs ~/.cache/ccache - build_nvhpc24-1-nvcc: name: NVHPC@24.1 NVCC/NVC++ Release [tests] runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false #env: # # For NVHPC, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v4 + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 - name: Dependencies + if: needs.skip_checks.outputs.skip == 'false' run: .github/workflows/dependencies/nvhpc.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -151,12 +161,12 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build & Install + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=600M ccache -z - source /etc/profile.d/modules.sh module load /opt/nvidia/hpc_sdk/modulefiles/nvhpc/24.1 which nvcc || echo "nvcc not in PATH!" @@ -166,12 +176,10 @@ jobs: nvc++ --version nvc --version cmake --version - export CC=$(which nvc) export CXX=$(which nvc++) export CUDACXX=$(which nvcc) export CUDAHOSTCXX=${CXX} - cmake -S . -B build \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DWarpX_COMPUTE=CUDA \ @@ -183,18 +191,15 @@ jobs: -DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON \ -DAMReX_CUDA_ERROR_CAPTURE_THIS=ON cmake --build build -j 4 - # work-around for mpi4py 3.1.1 build system issue with using # a GNU-built Python executable with non-GNU Python modules # https://github.com/mpi4py/mpi4py/issues/114 #export CFLAGS="-noswitcherror" - #python3 -m pip install --upgrade pip #python3 -m pip install --upgrade build packaging setuptools wheel #export WARPX_MPI=ON #export PYWARPX_LIB_DIR=$PWD/build/lib/site-packages/pywarpx/ #python3 -m pip wheel . #python3 -m pip install *.whl - ccache -s du -hs ~/.cache/ccache From 2a264cfdbf166d9c5dd7647e0cc39a3aba463013 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:40:33 -0800 Subject: [PATCH 31/51] Update hip workflow --- .github/workflows/hip.yml | 42 +++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/.github/workflows/hip.yml b/.github/workflows/hip.yml index 6ab4e4a8401..e25511fa315 100644 --- a/.github/workflows/hip.yml +++ b/.github/workflows/hip.yml @@ -5,53 +5,59 @@ on: branches: - "development" pull_request: - paths-ignore: - - "Docs/**" concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-hip cancel-in-progress: true jobs: + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: ubuntu-latest build_hip_3d_sp: name: HIP 3D SP runs-on: ubuntu-20.04 env: CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed" CMAKE_GENERATOR: Ninja + needs: skip_checks if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' shell: bash run: .github/workflows/dependencies/hip.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=100M ccache -z - source /etc/profile.d/rocm.sh hipcc --version which clang which clang++ export CXX=$(which clang++) export CC=$(which clang) - # "mpic++ --showme" forgets open-pal in Ubuntu 20.04 + OpenMPI 4.0.3 # https://bugs.launchpad.net/ubuntu/+source/openmpi/+bug/1941786 # https://github.com/open-mpi/ompi/issues/9317 export LDFLAGS="-lopen-pal" - cmake -S . -B build_sp \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DAMReX_AMD_ARCH=gfx900 \ @@ -63,54 +69,54 @@ jobs: -DWarpX_PRECISION=SINGLE \ -DWarpX_FFT=ON cmake --build build_sp -j 4 - export WARPX_MPI=OFF export PYWARPX_LIB_DIR=$PWD/build_sp/lib/site-packages/pywarpx/ python3 -m pip wheel . python3 -m pip install *.whl - ccache -s du -hs ~/.cache/ccache - build_hip_2d_dp: name: HIP 2D DP runs-on: ubuntu-20.04 env: CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed" CMAKE_GENERATOR: Ninja + needs: skip_checks if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' shell: bash run: .github/workflows/dependencies/hip.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=100M ccache -z - source /etc/profile.d/rocm.sh hipcc --version which clang which clang++ export CXX=$(which clang++) export CC=$(which clang) - # "mpic++ --showme" forgets open-pal in Ubuntu 20.04 + OpenMPI 4.0.3 # https://bugs.launchpad.net/ubuntu/+source/openmpi/+bug/1941786 # https://github.com/open-mpi/ompi/issues/9317 export LDFLAGS="-lopen-pal" - cmake -S . -B build_2d \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DAMReX_AMD_ARCH=gfx900 \ @@ -123,11 +129,9 @@ jobs: -DWarpX_PRECISION=DOUBLE \ -DWarpX_FFT=ON cmake --build build_2d -j 4 - export WARPX_MPI=OFF export PYWARPX_LIB_DIR=$PWD/build_2d/lib/site-packages/pywarpx/ python3 -m pip wheel . python3 -m pip install *.whl - ccache -s du -hs ~/.cache/ccache From 698cbfd7c158ac70c83cb2460947fb299686d5f4 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:45:03 -0800 Subject: [PATCH 32/51] Update insitu workflow --- .github/workflows/insitu.yml | 37 ++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/insitu.yml b/.github/workflows/insitu.yml index 50b482d28d3..7c98cd53fda 100644 --- a/.github/workflows/insitu.yml +++ b/.github/workflows/insitu.yml @@ -5,17 +5,21 @@ on: branches: - "development" pull_request: - paths-ignore: - - "Docs/**" concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-insituvis cancel-in-progress: true jobs: + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: macos-latest sensei: name: SENSEI runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CXX: clang++ @@ -27,21 +31,26 @@ jobs: container: image: senseiinsitu/ci:fedora35-amrex-20220613 steps: - - uses: actions/checkout@v4 + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 - name: Setup cmake + if: needs.skip_checks.outputs.skip == 'false' uses: jwlawson/actions-setup-cmake@v2 - name: Configure + if: needs.skip_checks.outputs.skip == 'false' run: | cmake -S . -B build \ -DWarpX_SENSEI=ON \ -DWarpX_COMPUTE=NOACC - name: Build + if: needs.skip_checks.outputs.skip == 'false' run: | cmake --build build -j 4 - ascent: name: Ascent runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CXX: g++ @@ -51,18 +60,23 @@ jobs: container: image: alpinedav/ascent:0.9.2 steps: - - uses: actions/checkout@v4 + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 - name: Configure + if: needs.skip_checks.outputs.skip == 'false' run: | . /ascent_docker_setup_env.sh cmake -S . -B build \ -DWarpX_ASCENT=ON \ -DWarpX_COMPUTE=NOACC - name: Build + if: needs.skip_checks.outputs.skip == 'false' run: | . /ascent_docker_setup_env.sh cmake --build build -j 4 - name: Test + if: needs.skip_checks.outputs.skip == 'false' run: | cp Examples/Physics_applications/laser_acceleration/inputs_base_3d . cp Examples/Physics_applications/laser_acceleration/3d_ascent_actions.yaml ascent_actions.yaml @@ -72,16 +86,17 @@ jobs: diag1.intervals = 30:40:10 \ diag1.format = ascent - uses: actions/upload-artifact@v4 + if: needs.skip_checks.outputs.skip == 'false' with: name: ascent-test-artifacts path: | *.png conduit_* if-no-files-found: error - catalyst: name: Catalyst runs-on: ubuntu-22.04 + needs: skip_checks if: github.event.pull_request.draft == false env: CXX: g++ @@ -90,22 +105,26 @@ jobs: CATALYST_DEBUG: 1 CATALYST_IMPLEMENTATION_PATHS: /opt/paraview/lib/catalyst OMP_NUM_THREADS: 1 - # Container build scripts: # https://gitlab.kitware.com/christos.tsolakis/catalyst-amrex-docker-images container: image: kitware/paraview:ci-catalyst-amrex-warpx-20240828 steps: - - uses: actions/checkout@v4 + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 - name: Configure + if: needs.skip_checks.outputs.skip == 'false' run: | cmake -S . -B build \ -DWarpX_DIMS="2;3" \ -DWarpX_CATALYST=ON - name: Build + if: needs.skip_checks.outputs.skip == 'false' run: | cmake --build build -j 10 - name: 2D Test + if: needs.skip_checks.outputs.skip == 'false' run: | cp Examples/Tests/field_ionization/inputs_test_2d_ionization_lab . cp Examples/Tests/field_ionization/catalyst_pipeline.py . @@ -117,6 +136,7 @@ jobs: diag1.species = "electrons ions"\ diag1.format = catalyst - name: 3D Test + if: needs.skip_checks.outputs.skip == 'false' run: | cp Examples/Tests/electrostatic_sphere/inputs_base_3d . cp Examples/Tests/electrostatic_sphere/catalyst_pipeline.py . @@ -128,6 +148,7 @@ jobs: diag1.format = catalyst\ diag1.intervals = 3 - uses: actions/upload-artifact@v4 + if: needs.skip_checks.outputs.skip == 'false' with: name: catalyst-test-artifacts path: | From b9e03e0ec6e3cad6102d31c2202c5d09e06bf914 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:50:24 -0800 Subject: [PATCH 33/51] Update intel workflow --- .github/workflows/intel.yml | 62 ++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 9b98c6e5990..dd442fe8806 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -5,8 +5,6 @@ on: branches: - "development" pull_request: - paths-ignore: - - "Docs/**" concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-intel @@ -15,42 +13,50 @@ concurrency: jobs: # Ref.: https://github.com/rscohn2/oneapi-ci # intel-basekit intel-hpckit are too large in size + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: macos-latest build_icc: name: oneAPI ICC SP&DP runs-on: ubuntu-20.04 + needs: skip_checks if: github.event.pull_request.draft == false # For oneAPI, Ninja is slower than the default: #env: # CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/icc.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 export CCACHE_MAXSIZE=200M export CCACHE_DEPEND=1 ccache -z - set +eu source /opt/intel/oneapi/setvars.sh set -eu export CXX=$(which icpc) export CC=$(which icc) - python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel - cmake -S . -B build_dp \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DpyAMReX_IPO=OFF \ @@ -60,7 +66,6 @@ jobs: -DWarpX_OPENPMD=ON \ -DWarpX_openpmd_internal=OFF cmake --build build_dp -j 4 - cmake -S . -B build_sp \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DpyAMReX_IPO=OFF \ @@ -72,10 +77,8 @@ jobs: -DWarpX_PRECISION=SINGLE cmake --build build_sp -j 4 cmake --build build_sp --target pip_install - ccache -s du -hs ~/.cache/ccache - build_icpx: name: oneAPI ICX SP runs-on: ubuntu-20.04 @@ -86,21 +89,27 @@ jobs: CXXFLAGS: "-Werror -Wno-error=pass-failed -Wno-tautological-constant-compare" # For oneAPI, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja + needs: skip_checks if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | .github/workflows/dependencies/dpcpp.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | export CCACHE_COMPRESS=1 @@ -108,17 +117,14 @@ jobs: export CCACHE_MAXSIZE=100M export CCACHE_DEPEND=1 ccache -z - set +e source /opt/intel/oneapi/setvars.sh set -e export PATH=$PATH:/opt/intel/oneapi/compiler/2024.2/bin # FIXME export CXX=$(which icpx) export CC=$(which icx) - python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel - cmake -S . -B build_sp \ -DCMAKE_CXX_FLAGS_RELEASE="-O1 -DNDEBUG" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ @@ -129,18 +135,16 @@ jobs: -DWarpX_PRECISION=SINGLE cmake --build build_sp -j 4 cmake --build build_sp --target pip_install - ccache -s du -hs ~/.cache/ccache - - - name: run pywarpx + - name: Run pywarpx + if: needs.skip_checks.outputs.skip == 'false' run: | set +e source /opt/intel/oneapi/setvars.sh set -e export OMP_NUM_THREADS=2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py - build_dpcc: name: oneAPI DPC++ SP runs-on: ubuntu-20.04 @@ -151,21 +155,27 @@ jobs: CXXFLAGS: "-Werror -Wno-tautological-constant-compare" # For oneAPI, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja + needs: skip_checks if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v4 - - name: install dependencies + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install dependencies + if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | .github/workflows/dependencies/dpcpp.sh - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' 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 + - name: Build WarpX + if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | export CCACHE_COMPRESS=1 @@ -173,7 +183,6 @@ jobs: export CCACHE_MAXSIZE=100M export CCACHE_DEPEND=1 ccache -z - set +e source /opt/intel/oneapi/setvars.sh set -e @@ -181,7 +190,6 @@ jobs: export CXX=$(which icpx) export CC=$(which icx) export CXXFLAGS="-fsycl ${CXXFLAGS}" - cmake -S . -B build_sp \ -DCMAKE_CXX_FLAGS_RELEASE="-O1 -DNDEBUG" \ -DBUILD_SHARED_LIBS=ON \ @@ -194,10 +202,8 @@ jobs: -DWarpX_OPENPMD=ON \ -DWarpX_PRECISION=SINGLE cmake --build build_sp -j 4 - ccache -s du -hs ~/.cache/ccache - # Skip this as it will copy the binary artifacts and we are tight on disk space # python3 -m pip install --upgrade pip # python3 -m pip install --upgrade build packaging setuptools wheel From af2933553910cc46fb60fb78afa5c50126fe3244 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:54:08 -0800 Subject: [PATCH 34/51] Update windows workflow --- .github/workflows/insitu.yml | 2 +- .github/workflows/intel.yml | 2 +- .github/workflows/windows.yml | 40 ++++++++++++++++++++++------------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/insitu.yml b/.github/workflows/insitu.yml index 7c98cd53fda..cdbc9d5c9ed 100644 --- a/.github/workflows/insitu.yml +++ b/.github/workflows/insitu.yml @@ -15,7 +15,7 @@ jobs: name: Analyze uses: ./.github/workflows/skip_checks.yml with: - runs-on: macos-latest + runs-on: ubuntu-latest sensei: name: SENSEI runs-on: ubuntu-20.04 diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index dd442fe8806..353e2bd907d 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -17,7 +17,7 @@ jobs: name: Analyze uses: ./.github/workflows/skip_checks.yml with: - runs-on: macos-latest + runs-on: ubuntu-latest build_icc: name: oneAPI ICC SP&DP runs-on: ubuntu-20.04 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ae4843e0536..132d872eda8 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -5,26 +5,35 @@ on: branches: - "development" pull_request: - paths-ignore: - - "Docs/**" concurrency: group: ${{ github.ref }}-${{ github.head_ref }}-windows cancel-in-progress: true jobs: + skip_checks: + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: ubuntu-latest # does not need to be windows build_win_msvc: name: MSVC C++17 w/o MPI runs-on: windows-latest + needs: skip_checks # disabled due to issues in #5230 if: 0 #if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install Python + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/setup-python@v5 with: python-version: '3.x' - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 # - once stored under a key, they become immutable (even if local cache path content changes) # - for a refresh the key has to change, e.g., hash of a tracked file in the key @@ -37,6 +46,7 @@ jobs: ccache-windows-winmsvc-${{ hashFiles('.github/workflows/windows.yml') }}- ccache-windows-winmsvc- - name: Build & Install + if: needs.skip_checks.outputs.skip == 'false' run: | cmake -S . -B build ` -DCMAKE_BUILD_TYPE=Debug ` @@ -48,7 +58,6 @@ jobs: if(!$?) { Exit $LASTEXITCODE } cmake --build build --config Debug --parallel 4 if(!$?) { Exit $LASTEXITCODE } - python3 -m pip install --upgrade pip if(!$?) { Exit $LASTEXITCODE } python3 -m pip install --upgrade build packaging setuptools wheel @@ -57,26 +66,30 @@ jobs: if(!$?) { Exit $LASTEXITCODE } cmake --build build --config Debug --target pip_install if(!$?) { Exit $LASTEXITCODE } - - name: Test + if: needs.skip_checks.outputs.skip == 'false' run: | $env:PATH += ';C:/Program Files (x86)/WarpX/bin/' - python3 Examples/Tests/gaussian_beam/inputs_test_3d_gaussian_beam_picmi.py # JSON writes are currently very slow (50min) with MSVC # --diagformat=openpmd - build_win_clang: name: Clang C++17 w/ OMP w/o MPI runs-on: windows-2019 + needs: skip_checks if: github.event.pull_request.draft == false steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Checkout code + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/checkout@v4 + - name: Install Python + if: needs.skip_checks.outputs.skip == 'false' + uses: actions/setup-python@v5 with: python-version: '3.8' - uses: seanmiddleditch/gha-setup-ninja@master - name: CCache Cache + if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 # - once stored under a key, they become immutable (even if local cache path content changes) # - for a refresh the key has to change, e.g., hash of a tracked file in the key @@ -89,6 +102,7 @@ jobs: ccache-windows-winclang-${{ hashFiles('.github/workflows/windows.yml') }}- ccache-windows-winclang- - name: Build & Install + if: needs.skip_checks.outputs.skip == 'false' shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64 @@ -106,25 +120,21 @@ jobs: if errorlevel 1 exit 1 cmake --build build --config Release --parallel 4 if errorlevel 1 exit 1 - cmake --build build --config Release --target install if errorlevel 1 exit 1 - python3 -m pip install --upgrade pip if errorlevel 1 exit 1 python3 -m pip install --upgrade build packaging setuptools wheel if errorlevel 1 exit 1 python3 -m pip install --upgrade -r requirements.txt if errorlevel 1 exit 1 - cmake --build build --config Release --target pip_install if errorlevel 1 exit 1 - - name: Test + if: needs.skip_checks.outputs.skip == 'false' shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64 set "PATH=C:/Program Files (x86)/WarpX/bin/;%PATH%" - python3 Examples/Tests/gaussian_beam/inputs_test_3d_gaussian_beam_picmi.py --diagformat=openpmd if errorlevel 1 exit 1 From f523373364c90eb8d4980b3367a7f14bba77938f Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 11:55:43 -0800 Subject: [PATCH 35/51] Fix windows workflow --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 132d872eda8..116334cd25a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -88,6 +88,7 @@ jobs: with: python-version: '3.8' - uses: seanmiddleditch/gha-setup-ninja@master + if: needs.skip_checks.outputs.skip == 'false' - name: CCache Cache if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 From eb21f6a54824add2ff570c92cfffdb7903ab0422 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 12:02:43 -0800 Subject: [PATCH 36/51] Try skipping full job in macOS workflow --- .github/workflows/macos.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4974e1e5931..cb2b5ab0986 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -20,22 +20,22 @@ jobs: name: AppleClang runs-on: macos-latest needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE # For macOS, Ninja is slower than the default: #CMAKE_GENERATOR: Ninja steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' + #if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install Python - if: needs.skip_checks.outputs.skip == 'false' + #if: needs.skip_checks.outputs.skip == 'false' uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install brew dependencies - if: needs.skip_checks.outputs.skip == 'false' + #if: needs.skip_checks.outputs.skip == 'false' run: | set +e brew unlink gcc @@ -52,14 +52,14 @@ jobs: brew tap openpmd/openpmd brew install openpmd-api - name: Install pip dependencies - if: needs.skip_checks.outputs.skip == 'false' + #if: needs.skip_checks.outputs.skip == 'false' run: | python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel python3 -m pip install --upgrade mpi4py python3 -m pip install --upgrade -r Regression/requirements.txt - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' + #if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/Library/Caches/ccache @@ -67,7 +67,7 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' + #if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -93,7 +93,7 @@ jobs: du -hs ~/Library/Caches/ccache ccache -s - name: Run pywarpx - if: needs.skip_checks.outputs.skip == 'false' + #if: needs.skip_checks.outputs.skip == 'false' run: | export OMP_NUM_THREADS=1 mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py From 5c46e8d32e3738d8e6f4ee1de2e489c75e627bd4 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 13:21:17 -0800 Subject: [PATCH 37/51] Skip full jobs in all workflows --- .github/workflows/clang_sanitizers.yml | 14 ++--------- .github/workflows/clang_tidy.yml | 6 +---- .github/workflows/codeql.yml | 18 +++++---------- .github/workflows/cuda.yml | 20 +++------------- .github/workflows/hip.yml | 12 ++-------- .github/workflows/insitu.yml | 21 +++-------------- .github/workflows/intel.yml | 19 +++------------ .github/workflows/macos.yml | 7 ------ .github/workflows/ubuntu.yml | 32 ++++---------------------- .github/workflows/windows.yml | 15 ++---------- 10 files changed, 27 insertions(+), 137 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 506f81d08e2..41f73a3b5ed 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-22.04 container: ubuntu:23.10 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CC: clang CXX: clang++ @@ -29,14 +29,11 @@ jobs: #CMAKE_GENERATOR: Ninja steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/clang17.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -44,7 +41,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -68,7 +64,6 @@ jobs: ccache -s du -hs ~/.cache/ccache - name: Run with UB sanitizer - if: needs.skip_checks.outputs.skip == 'false' run: | # We need these two lines because these tests run inside a docker container export OMPI_ALLOW_RUN_AS_ROOT=1 @@ -85,7 +80,7 @@ jobs: runs-on: ubuntu-22.04 container: ubuntu:23.10 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CC: clang CXX: clang++ @@ -93,14 +88,11 @@ jobs: #CMAKE_GENERATOR: Ninja steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/clang17.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -108,7 +100,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -146,7 +137,6 @@ jobs: ccache -s du -hs ~/.cache/ccache - name: Run with thread sanitizer - if: needs.skip_checks.outputs.skip == 'false' run: | export PMIX_MCA_gds=hash export TSAN_OPTIONS='ignore_noninstrumented_modules=1' diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 716c5da4821..2abbd78e0aa 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -24,17 +24,14 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 180 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/clang15.sh - name: Set up cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -42,7 +39,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX & run clang-tidy - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 163c57697d5..b8f3e372ca1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -22,7 +22,7 @@ jobs: name: Analyze runs-on: ubuntu-latest needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} permissions: actions: read contents: read @@ -33,15 +33,13 @@ jobs: language: [ python, cpp ] steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install Python - if: needs.skip_checks.outputs.skip == 'false' uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install Packages (C++) - if: ${{ needs.skip_checks.outputs.skip == 'false' && matrix.language == 'cpp' }} + 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 @@ -51,7 +49,7 @@ jobs: python -m pip install --upgrade cmake python -m pipx install cmake - name: Set Up Cache - if: ${{ needs.skip_checks.outputs.skip == 'false' && matrix.language == 'cpp' }} + if: ${{ matrix.language == 'cpp' }} uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -59,21 +57,20 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Configure (C++) - if: ${{ needs.skip_checks.outputs.skip == 'false' && matrix.language == 'cpp' }} + if: ${{ matrix.language == 'cpp' }} run: | cmake -S . -B build -DWarpX_OPENPMD=ON - name: Initialize CodeQL - if: needs.skip_checks.outputs.skip == 'false' uses: github/codeql-action/init@v3 with: config-file: ./.github/codeql/warpx-codeql.yml languages: ${{ matrix.language }} queries: +security-and-quality - name: Build (py) - if: ${{ needs.skip_checks.outputs.skip == 'false' && matrix.language == 'python' }} + if: ${{ matrix.language == 'python' }} uses: github/codeql-action/autobuild@v3 - name: Build (C++) - if: ${{ needs.skip_checks.outputs.skip == 'false' && matrix.language == 'cpp' }} + if: ${{ matrix.language == 'cpp' }} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -87,14 +84,12 @@ jobs: export CCACHE_DISABLE=1 cmake --build build -j 4 - name: Perform CodeQL Analysis - if: needs.skip_checks.outputs.skip == 'false' uses: github/codeql-action/analyze@v3 with: category: "/language:${{ matrix.language }}" upload: False output: sarif-results - name: filter-sarif - if: needs.skip_checks.outputs.skip == 'false' uses: advanced-security/filter-sarif@v1 with: patterns: | @@ -108,7 +103,6 @@ jobs: input: sarif-results/${{ matrix.language }}.sarif output: sarif-results/${{ matrix.language }}.sarif - name: Upload SARIF - if: needs.skip_checks.outputs.skip == 'false' uses: github/codeql-action/upload-sarif@v3 with: sarif_file: sarif-results/${{ matrix.language }}.sarif diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 2ccb6285b2d..b922b757fb0 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -24,25 +24,21 @@ jobs: name: NVCC 11.3 SP runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXXFLAGS: "-Werror" CMAKE_GENERATOR: Ninja steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install Python - if: needs.skip_checks.outputs.skip == 'false' uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/nvcc11-3.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -50,7 +46,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Install openPMD-api - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -70,7 +65,6 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \ -DCMAKE_VERBOSE_MAKEFILE=ON - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -105,17 +99,14 @@ jobs: name: NVCC 11.8.0 GNUmake runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/nvcc11-8.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -123,7 +114,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -141,19 +131,16 @@ jobs: name: NVHPC@24.1 NVCC/NVC++ Release [tests] runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} #env: # # For NVHPC, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Dependencies - if: needs.skip_checks.outputs.skip == 'false' run: .github/workflows/dependencies/nvhpc.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -161,7 +148,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build & Install - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 diff --git a/.github/workflows/hip.yml b/.github/workflows/hip.yml index e25511fa315..f97986d9a4e 100644 --- a/.github/workflows/hip.yml +++ b/.github/workflows/hip.yml @@ -23,17 +23,14 @@ jobs: CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed" CMAKE_GENERATOR: Ninja needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' shell: bash run: .github/workflows/dependencies/hip.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -41,7 +38,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | export CCACHE_COMPRESS=1 @@ -82,17 +78,14 @@ jobs: CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed" CMAKE_GENERATOR: Ninja needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' shell: bash run: .github/workflows/dependencies/hip.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -100,7 +93,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | export CCACHE_COMPRESS=1 diff --git a/.github/workflows/insitu.yml b/.github/workflows/insitu.yml index cdbc9d5c9ed..8d258caadac 100644 --- a/.github/workflows/insitu.yml +++ b/.github/workflows/insitu.yml @@ -20,7 +20,7 @@ jobs: name: SENSEI runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXX: clang++ CC: clang @@ -32,26 +32,22 @@ jobs: image: senseiinsitu/ci:fedora35-amrex-20220613 steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Setup cmake - if: needs.skip_checks.outputs.skip == 'false' uses: jwlawson/actions-setup-cmake@v2 - name: Configure - if: needs.skip_checks.outputs.skip == 'false' run: | cmake -S . -B build \ -DWarpX_SENSEI=ON \ -DWarpX_COMPUTE=NOACC - name: Build - if: needs.skip_checks.outputs.skip == 'false' run: | cmake --build build -j 4 ascent: name: Ascent runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXX: g++ CC: gcc @@ -61,22 +57,18 @@ jobs: image: alpinedav/ascent:0.9.2 steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Configure - if: needs.skip_checks.outputs.skip == 'false' run: | . /ascent_docker_setup_env.sh cmake -S . -B build \ -DWarpX_ASCENT=ON \ -DWarpX_COMPUTE=NOACC - name: Build - if: needs.skip_checks.outputs.skip == 'false' run: | . /ascent_docker_setup_env.sh cmake --build build -j 4 - name: Test - if: needs.skip_checks.outputs.skip == 'false' run: | cp Examples/Physics_applications/laser_acceleration/inputs_base_3d . cp Examples/Physics_applications/laser_acceleration/3d_ascent_actions.yaml ascent_actions.yaml @@ -86,7 +78,6 @@ jobs: diag1.intervals = 30:40:10 \ diag1.format = ascent - uses: actions/upload-artifact@v4 - if: needs.skip_checks.outputs.skip == 'false' with: name: ascent-test-artifacts path: | @@ -97,7 +88,7 @@ jobs: name: Catalyst runs-on: ubuntu-22.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXX: g++ CC: gcc @@ -111,20 +102,16 @@ jobs: image: kitware/paraview:ci-catalyst-amrex-warpx-20240828 steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Configure - if: needs.skip_checks.outputs.skip == 'false' run: | cmake -S . -B build \ -DWarpX_DIMS="2;3" \ -DWarpX_CATALYST=ON - name: Build - if: needs.skip_checks.outputs.skip == 'false' run: | cmake --build build -j 10 - name: 2D Test - if: needs.skip_checks.outputs.skip == 'false' run: | cp Examples/Tests/field_ionization/inputs_test_2d_ionization_lab . cp Examples/Tests/field_ionization/catalyst_pipeline.py . @@ -136,7 +123,6 @@ jobs: diag1.species = "electrons ions"\ diag1.format = catalyst - name: 3D Test - if: needs.skip_checks.outputs.skip == 'false' run: | cp Examples/Tests/electrostatic_sphere/inputs_base_3d . cp Examples/Tests/electrostatic_sphere/catalyst_pipeline.py . @@ -148,7 +134,6 @@ jobs: diag1.format = catalyst\ diag1.intervals = 3 - uses: actions/upload-artifact@v4 - if: needs.skip_checks.outputs.skip == 'false' with: name: catalyst-test-artifacts path: | diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 353e2bd907d..90e5f5fd785 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -22,20 +22,17 @@ jobs: name: oneAPI ICC SP&DP runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} # For oneAPI, Ninja is slower than the default: #env: # CMAKE_GENERATOR: Ninja steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/icc.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -43,7 +40,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -90,18 +86,15 @@ jobs: # For oneAPI, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | .github/workflows/dependencies/dpcpp.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -109,7 +102,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | export CCACHE_COMPRESS=1 @@ -138,7 +130,6 @@ jobs: ccache -s du -hs ~/.cache/ccache - name: Run pywarpx - if: needs.skip_checks.outputs.skip == 'false' run: | set +e source /opt/intel/oneapi/setvars.sh @@ -156,18 +147,15 @@ jobs: # For oneAPI, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | .github/workflows/dependencies/dpcpp.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -175,7 +163,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' shell: bash run: | export CCACHE_COMPRESS=1 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index cb2b5ab0986..8c4f62c778b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -27,15 +27,12 @@ jobs: #CMAKE_GENERATOR: Ninja steps: - name: Checkout code - #if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install Python - #if: needs.skip_checks.outputs.skip == 'false' uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install brew dependencies - #if: needs.skip_checks.outputs.skip == 'false' run: | set +e brew unlink gcc @@ -52,14 +49,12 @@ jobs: brew tap openpmd/openpmd brew install openpmd-api - name: Install pip dependencies - #if: needs.skip_checks.outputs.skip == 'false' run: | python3 -m pip install --upgrade pip python3 -m pip install --upgrade build packaging setuptools wheel python3 -m pip install --upgrade mpi4py python3 -m pip install --upgrade -r Regression/requirements.txt - name: CCache Cache - #if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/Library/Caches/ccache @@ -67,7 +62,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - #if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -93,7 +87,6 @@ jobs: du -hs ~/Library/Caches/ccache ccache -s - name: Run pywarpx - #if: needs.skip_checks.outputs.skip == 'false' run: | export OMP_NUM_THREADS=1 mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5b2e9cef363..c8f04393fdd 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -20,19 +20,16 @@ jobs: name: GCC Minimal w/o MPI runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXXFLAGS: "-Werror" steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/gcc.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -40,7 +37,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -61,21 +57,18 @@ jobs: name: GCC 1D & 2D w/ MPI, QED tools runs-on: ubuntu-22.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXXFLAGS: "-Werror" CXX: "g++-12" CC: "gcc-12" steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/gcc12.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -83,7 +76,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -103,27 +95,23 @@ jobs: ccache -s du -hs ~/.cache/ccache - name: Run QED table tools - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/scripts/checkQEDTableGenerator.sh build_3D_sp: name: GCC 3D & RZ w/ MPI, single precision runs-on: ubuntu-22.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXX: "g++-12" CC: "gcc-12" steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/gcc12_blaspp_lapackpp.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -131,7 +119,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -158,21 +145,18 @@ jobs: name: GCC ABLASTR w/o MPI runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CMAKE_GENERATOR: Ninja CXXFLAGS: "-Werror" steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/gcc.sh sudo apt-get install -y libopenmpi-dev openmpi-bin - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -180,7 +164,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -197,7 +180,7 @@ jobs: name: Clang pywarpx runs-on: ubuntu-20.04 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CC: clang CXX: clang++ @@ -205,14 +188,11 @@ jobs: #CMAKE_GENERATOR: Ninja steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install dependencies - if: needs.skip_checks.outputs.skip == 'false' run: | .github/workflows/dependencies/pyfull.sh - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -220,7 +200,6 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX - if: needs.skip_checks.outputs.skip == 'false' run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 @@ -238,7 +217,6 @@ jobs: ccache -s du -hs ~/.cache/ccache - name: Run pywarpx - if: needs.skip_checks.outputs.skip == 'false' run: | export OMP_NUM_THREADS=1 mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 116334cd25a..4b22bd4e1a6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -22,18 +22,15 @@ jobs: needs: skip_checks # disabled due to issues in #5230 if: 0 - #if: github.event.pull_request.draft == false + #if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install Python - if: needs.skip_checks.outputs.skip == 'false' uses: actions/setup-python@v5 with: python-version: '3.x' - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 # - once stored under a key, they become immutable (even if local cache path content changes) # - for a refresh the key has to change, e.g., hash of a tracked file in the key @@ -46,7 +43,6 @@ jobs: ccache-windows-winmsvc-${{ hashFiles('.github/workflows/windows.yml') }}- ccache-windows-winmsvc- - name: Build & Install - if: needs.skip_checks.outputs.skip == 'false' run: | cmake -S . -B build ` -DCMAKE_BUILD_TYPE=Debug ` @@ -67,7 +63,6 @@ jobs: cmake --build build --config Debug --target pip_install if(!$?) { Exit $LASTEXITCODE } - name: Test - if: needs.skip_checks.outputs.skip == 'false' run: | $env:PATH += ';C:/Program Files (x86)/WarpX/bin/' python3 Examples/Tests/gaussian_beam/inputs_test_3d_gaussian_beam_picmi.py @@ -77,20 +72,16 @@ jobs: name: Clang C++17 w/ OMP w/o MPI runs-on: windows-2019 needs: skip_checks - if: github.event.pull_request.draft == false + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code - if: needs.skip_checks.outputs.skip == 'false' uses: actions/checkout@v4 - name: Install Python - if: needs.skip_checks.outputs.skip == 'false' uses: actions/setup-python@v5 with: python-version: '3.8' - uses: seanmiddleditch/gha-setup-ninja@master - if: needs.skip_checks.outputs.skip == 'false' - name: CCache Cache - if: needs.skip_checks.outputs.skip == 'false' uses: actions/cache@v4 # - once stored under a key, they become immutable (even if local cache path content changes) # - for a refresh the key has to change, e.g., hash of a tracked file in the key @@ -103,7 +94,6 @@ jobs: ccache-windows-winclang-${{ hashFiles('.github/workflows/windows.yml') }}- ccache-windows-winclang- - name: Build & Install - if: needs.skip_checks.outputs.skip == 'false' shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64 @@ -132,7 +122,6 @@ jobs: cmake --build build --config Release --target pip_install if errorlevel 1 exit 1 - name: Test - if: needs.skip_checks.outputs.skip == 'false' shell: cmd run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64 From 488add99a62afce72c723603a47da74bfcfed770 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 13:33:07 -0800 Subject: [PATCH 38/51] Skip each clang tidy matrix workflow --- .github/workflows/clang_tidy.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 2abbd78e0aa..373d433e11f 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -24,14 +24,17 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 180 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false }} steps: - name: Checkout code + if: ${{ needs.skip_checks.outputs.skip == 'false' }} uses: actions/checkout@v4 - name: Install dependencies + if: ${{ needs.skip_checks.outputs.skip == 'false' }} run: | .github/workflows/dependencies/clang15.sh - name: Set up cache + if: ${{ needs.skip_checks.outputs.skip == 'false' }} uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -39,6 +42,7 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX & run clang-tidy + if: ${{ needs.skip_checks.outputs.skip == 'false' }} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 From 90a2751d24c169fdd08f95f99094c84778410447 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 13:58:10 -0800 Subject: [PATCH 39/51] Revert changes done only for testing --- .azure-pipelines.yml | 2 -- .github/workflows/scripts/check_diff.sh | 2 -- Docs/source/index.rst | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 72daa035fba..d22097a208f 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -13,8 +13,6 @@ pr: paths: exclude: - Docs - - .github/workflows/** - - .azure-pipelines.yml jobs: - job: diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 15342e5a4c8..f0bbf79840b 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -24,8 +24,6 @@ cat check_diff.txt # Set paths to ignore paths_ignore=() paths_ignore+=("Docs/") -paths_ignore+=(".github/") -paths_ignore+=(".azure-pipelines.yml") echo "Paths to ignore:" echo ${paths_ignore[@]} diff --git a/Docs/source/index.rst b/Docs/source/index.rst index 8e9a56e3fd7..9668620976a 100644 --- a/Docs/source/index.rst +++ b/Docs/source/index.rst @@ -24,7 +24,7 @@ Contact us If you are starting using WarpX, or if you have a user question, please pop in our `discussions page `__ and get in touch with the community. -The `WarpX GitHub repository `__ is the main communication platform. +The `WarpX GitHub repo `__ is the main communication platform. Have a look at the action icons on the top right of the web page: feel free to watch the repo if you want to receive updates, or to star the repo to support the project. For bug reports or to request new features, you can also open a new `issue `__. From c4681e1e3e8d18c33de964d3b450a7cf4fb70782 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 14:09:30 -0800 Subject: [PATCH 40/51] Fix `if` condition --- .github/workflows/clang_sanitizers.yml | 4 ++-- .github/workflows/clang_tidy.yml | 8 ++++---- .github/workflows/codeql.yml | 2 +- .github/workflows/cuda.yml | 6 +++--- .github/workflows/hip.yml | 4 ++-- .github/workflows/insitu.yml | 6 +++--- .github/workflows/intel.yml | 6 +++--- .github/workflows/macos.yml | 2 +- .github/workflows/ubuntu.yml | 10 +++++----- .github/workflows/windows.yml | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 41f73a3b5ed..27e99d2bac2 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-22.04 container: ubuntu:23.10 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CC: clang CXX: clang++ @@ -80,7 +80,7 @@ jobs: runs-on: ubuntu-22.04 container: ubuntu:23.10 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CC: clang CXX: clang++ diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 373d433e11f..2f981041ed8 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -27,14 +27,14 @@ jobs: if: ${{ github.event.pull_request.draft == false }} steps: - name: Checkout code - if: ${{ needs.skip_checks.outputs.skip == 'false' }} + if: ${{ needs.skip_checks.outputs.skip == false }} uses: actions/checkout@v4 - name: Install dependencies - if: ${{ needs.skip_checks.outputs.skip == 'false' }} + if: ${{ needs.skip_checks.outputs.skip == false }} run: | .github/workflows/dependencies/clang15.sh - name: Set up cache - if: ${{ needs.skip_checks.outputs.skip == 'false' }} + if: ${{ needs.skip_checks.outputs.skip == false }} uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -42,7 +42,7 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX & run clang-tidy - if: ${{ needs.skip_checks.outputs.skip == 'false' }} + if: ${{ needs.skip_checks.outputs.skip == false }} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b8f3e372ca1..26d13a24317 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -22,7 +22,7 @@ jobs: name: Analyze runs-on: ubuntu-latest needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} permissions: actions: read contents: read diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index b922b757fb0..11c4942fd0c 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -24,7 +24,7 @@ jobs: name: NVCC 11.3 SP runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CXXFLAGS: "-Werror" CMAKE_GENERATOR: Ninja @@ -99,7 +99,7 @@ jobs: name: NVCC 11.8.0 GNUmake runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -131,7 +131,7 @@ jobs: name: NVHPC@24.1 NVCC/NVC++ Release [tests] runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} #env: # # For NVHPC, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja diff --git a/.github/workflows/hip.yml b/.github/workflows/hip.yml index f97986d9a4e..36cc2a14d3c 100644 --- a/.github/workflows/hip.yml +++ b/.github/workflows/hip.yml @@ -23,7 +23,7 @@ jobs: CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed" CMAKE_GENERATOR: Ninja needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -78,7 +78,7 @@ jobs: CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed" CMAKE_GENERATOR: Ninja needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/insitu.yml b/.github/workflows/insitu.yml index 8d258caadac..a63c72bf59e 100644 --- a/.github/workflows/insitu.yml +++ b/.github/workflows/insitu.yml @@ -20,7 +20,7 @@ jobs: name: SENSEI runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CXX: clang++ CC: clang @@ -47,7 +47,7 @@ jobs: name: Ascent runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CXX: g++ CC: gcc @@ -88,7 +88,7 @@ jobs: name: Catalyst runs-on: ubuntu-22.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CXX: g++ CC: gcc diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 90e5f5fd785..3f0d6e341e2 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -22,7 +22,7 @@ jobs: name: oneAPI ICC SP&DP runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} # For oneAPI, Ninja is slower than the default: #env: # CMAKE_GENERATOR: Ninja @@ -86,7 +86,7 @@ jobs: # For oneAPI, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -147,7 +147,7 @@ jobs: # For oneAPI, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8c4f62c778b..92427832eed 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -20,7 +20,7 @@ jobs: name: AppleClang runs-on: macos-latest needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE # For macOS, Ninja is slower than the default: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c8f04393fdd..c6b7a7d2105 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -20,7 +20,7 @@ jobs: name: GCC Minimal w/o MPI runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CXXFLAGS: "-Werror" steps: @@ -57,7 +57,7 @@ jobs: name: GCC 1D & 2D w/ MPI, QED tools runs-on: ubuntu-22.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CXXFLAGS: "-Werror" CXX: "g++-12" @@ -101,7 +101,7 @@ jobs: name: GCC 3D & RZ w/ MPI, single precision runs-on: ubuntu-22.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CXX: "g++-12" CC: "gcc-12" @@ -145,7 +145,7 @@ jobs: name: GCC ABLASTR w/o MPI runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CMAKE_GENERATOR: Ninja CXXFLAGS: "-Werror" @@ -180,7 +180,7 @@ jobs: name: Clang pywarpx runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} env: CC: clang CXX: clang++ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4b22bd4e1a6..66a0a405342 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -22,7 +22,7 @@ jobs: needs: skip_checks # disabled due to issues in #5230 if: 0 - #if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + #if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -72,7 +72,7 @@ jobs: name: Clang C++17 w/ OMP w/o MPI runs-on: windows-2019 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} steps: - name: Checkout code uses: actions/checkout@v4 From 3ddb4122f4b29156cc929166b18dc4550da626c0 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 14:11:20 -0800 Subject: [PATCH 41/51] Test `if` condition --- .github/workflows/scripts/check_diff.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index f0bbf79840b..15342e5a4c8 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -24,6 +24,8 @@ cat check_diff.txt # Set paths to ignore paths_ignore=() paths_ignore+=("Docs/") +paths_ignore+=(".github/") +paths_ignore+=(".azure-pipelines.yml") echo "Paths to ignore:" echo ${paths_ignore[@]} From 7dcd71697aa46c77d72c6777651ae6387b9f19ee Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 14:14:12 -0800 Subject: [PATCH 42/51] Debug `if` condition --- .github/workflows/macos.yml | 2 ++ .github/workflows/skip_checks.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 92427832eed..94e47af18ad 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -26,6 +26,8 @@ jobs: # For macOS, Ninja is slower than the default: #CMAKE_GENERATOR: Ninja steps: + - name: Debugging + run: echo "SKIP=${{ needs.skip_checks.outputs }}" - name: Checkout code uses: actions/checkout@v4 - name: Install Python diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml index e3bf538ee25..dd4e1970d74 100644 --- a/.github/workflows/skip_checks.yml +++ b/.github/workflows/skip_checks.yml @@ -20,5 +20,7 @@ jobs: ${{ github.event.pull_request.head.ref }} \ ${{ github.event.pull_request.base.ref }} \ ${{ github.event.pull_request.head.repo.clone_url }} + - name: Debug + run: echo "env.SKIP_CHECKS=${{ env.SKIP_CHECKS }}" outputs: skip: ${{ env.SKIP_CHECKS }} From eb2cb20eba05b7a87ac839bb6819689523f09182 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 14:35:57 -0800 Subject: [PATCH 43/51] Do not use shared YAML file --- .github/workflows/macos.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 94e47af18ad..56ad80a0b3c 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,11 +11,29 @@ concurrency: cancel-in-progress: true jobs: + #skip_checks: + # name: Analyze + # uses: ./.github/workflows/skip_checks.yml + # with: + # runs-on: macos-latest skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: macos-latest + name: Skip + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Analyze PR + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + - name: Debug + run: echo "env.SKIP_CHECKS=${{ env.SKIP_CHECKS }}" + outputs: + skip: ${{ env.SKIP_CHECKS }} build_appleclang: name: AppleClang runs-on: macos-latest @@ -27,7 +45,7 @@ jobs: #CMAKE_GENERATOR: Ninja steps: - name: Debugging - run: echo "SKIP=${{ needs.skip_checks.outputs }}" + run: echo "SKIP=${{ needs.skip_checks.outputs.skip }}" - name: Checkout code uses: actions/checkout@v4 - name: Install Python From cfbcd0b4862060c62381daa89e2594e2a6386169 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 14:42:58 -0800 Subject: [PATCH 44/51] Try setting `SKIP_CHECKS` to string --- .github/workflows/macos.yml | 47 +++++++++++++------------ .github/workflows/scripts/check_diff.sh | 4 +-- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 56ad80a0b3c..320fa5b016d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -11,34 +11,35 @@ concurrency: cancel-in-progress: true jobs: - #skip_checks: - # name: Analyze - # uses: ./.github/workflows/skip_checks.yml - # with: - # runs-on: macos-latest skip_checks: - name: Skip - runs-on: macos-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Analyze PR - run: | - .github/workflows/scripts/check_diff.sh \ - ${{ github.event.pull_request.head.ref }} \ - ${{ github.event.pull_request.base.ref }} \ - ${{ github.event.pull_request.head.repo.clone_url }} - - name: Debug - run: echo "env.SKIP_CHECKS=${{ env.SKIP_CHECKS }}" - outputs: - skip: ${{ env.SKIP_CHECKS }} + name: Analyze + uses: ./.github/workflows/skip_checks.yml + with: + runs-on: macos-latest + #skip_checks: + # name: Skip + # runs-on: macos-latest + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # - name: Analyze PR + # run: | + # .github/workflows/scripts/check_diff.sh \ + # ${{ github.event.pull_request.head.ref }} \ + # ${{ github.event.pull_request.base.ref }} \ + # ${{ github.event.pull_request.head.repo.clone_url }} + # - name: Debug + # run: echo "env.SKIP_CHECKS=${{ env.SKIP_CHECKS }}" + # outputs: + # skip: ${{ env.SKIP_CHECKS }} build_appleclang: name: AppleClang runs-on: macos-latest needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + #if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} + if: ${{ github.event.pull_request.draft == false }} env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE # For macOS, Ninja is slower than the default: diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 15342e5a4c8..3a3eeda0ad9 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -35,8 +35,8 @@ paths_ignore_string=$(IFS='|'; echo "${paths_ignore[*]}") # Set skip variable after inspecting files changed if ! grep -qEv "^(${paths_ignore_string})" check_diff.txt; then echo "Skip checks" - echo "SKIP_CHECKS=true" >> ${GITHUB_ENV} + echo "SKIP_CHECKS='true'" >> ${GITHUB_ENV} else echo "Run checks" - echo "SKIP_CHECKS=false" >> ${GITHUB_ENV} + echo "SKIP_CHECKS='false'" >> ${GITHUB_ENV} fi From a7dce8e9710197f912094f86277d816e2063f538 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 14:45:05 -0800 Subject: [PATCH 45/51] Output from separate workflow file does not work --- .github/workflows/macos.yml | 39 +++++++++++-------------- .github/workflows/scripts/check_diff.sh | 4 +-- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 320fa5b016d..61340b5b676 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,28 +12,23 @@ concurrency: jobs: skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: macos-latest - #skip_checks: - # name: Skip - # runs-on: macos-latest - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # - name: Analyze PR - # run: | - # .github/workflows/scripts/check_diff.sh \ - # ${{ github.event.pull_request.head.ref }} \ - # ${{ github.event.pull_request.base.ref }} \ - # ${{ github.event.pull_request.head.repo.clone_url }} - # - name: Debug - # run: echo "env.SKIP_CHECKS=${{ env.SKIP_CHECKS }}" - # outputs: - # skip: ${{ env.SKIP_CHECKS }} + name: Skip + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Analyze PR + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + - name: Debug + run: echo "env.SKIP_CHECKS=${{ env.SKIP_CHECKS }}" + outputs: + skip: ${{ env.SKIP_CHECKS }} build_appleclang: name: AppleClang runs-on: macos-latest diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 3a3eeda0ad9..15342e5a4c8 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -35,8 +35,8 @@ paths_ignore_string=$(IFS='|'; echo "${paths_ignore[*]}") # Set skip variable after inspecting files changed if ! grep -qEv "^(${paths_ignore_string})" check_diff.txt; then echo "Skip checks" - echo "SKIP_CHECKS='true'" >> ${GITHUB_ENV} + echo "SKIP_CHECKS=true" >> ${GITHUB_ENV} else echo "Run checks" - echo "SKIP_CHECKS='false'" >> ${GITHUB_ENV} + echo "SKIP_CHECKS=false" >> ${GITHUB_ENV} fi From 4094c1f6d94fa1e518a5cdb3bfd0854205f15fab Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 14:46:36 -0800 Subject: [PATCH 46/51] Test new fix --- .github/workflows/macos.yml | 11 +++-------- .github/workflows/scripts/check_diff.sh | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 61340b5b676..f06911d3ff8 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -12,36 +12,31 @@ concurrency: jobs: skip_checks: - name: Skip + name: Analyze PR runs-on: macos-latest steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Analyze PR + - name: Skip checks? run: | .github/workflows/scripts/check_diff.sh \ ${{ github.event.pull_request.head.ref }} \ ${{ github.event.pull_request.base.ref }} \ ${{ github.event.pull_request.head.repo.clone_url }} - - name: Debug - run: echo "env.SKIP_CHECKS=${{ env.SKIP_CHECKS }}" outputs: skip: ${{ env.SKIP_CHECKS }} build_appleclang: name: AppleClang runs-on: macos-latest needs: skip_checks - #if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} - if: ${{ github.event.pull_request.draft == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE # For macOS, Ninja is slower than the default: #CMAKE_GENERATOR: Ninja steps: - - name: Debugging - run: echo "SKIP=${{ needs.skip_checks.outputs.skip }}" - name: Checkout code uses: actions/checkout@v4 - name: Install Python diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 15342e5a4c8..266035a4368 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -24,8 +24,8 @@ cat check_diff.txt # Set paths to ignore paths_ignore=() paths_ignore+=("Docs/") -paths_ignore+=(".github/") -paths_ignore+=(".azure-pipelines.yml") +#paths_ignore+=(".github/") +#paths_ignore+=(".azure-pipelines.yml") echo "Paths to ignore:" echo ${paths_ignore[@]} From 5119f4ccaf9da7b560fe7765f57bf48a9936847e Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 15:02:59 -0800 Subject: [PATCH 47/51] Fix all workflows --- .github/workflows/clang_sanitizers.yml | 23 +++++++++++++++----- .github/workflows/clang_tidy.yml | 29 +++++++++++++++++-------- .github/workflows/codeql.yml | 21 +++++++++++++----- .github/workflows/cuda.yml | 25 +++++++++++++++------ .github/workflows/hip.yml | 23 +++++++++++++++----- .github/workflows/insitu.yml | 25 +++++++++++++++------ .github/workflows/intel.yml | 25 +++++++++++++++------ .github/workflows/scripts/check_diff.sh | 4 ++-- .github/workflows/ubuntu.yml | 29 +++++++++++++++++-------- .github/workflows/windows.yml | 23 +++++++++++++++----- 10 files changed, 163 insertions(+), 64 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 27e99d2bac2..52a91b4a167 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -12,16 +12,27 @@ concurrency: jobs: skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest + name: Analyze PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} build_UB_sanitizer: name: Clang UB sanitizer runs-on: ubuntu-22.04 container: ubuntu:23.10 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CC: clang CXX: clang++ @@ -80,7 +91,7 @@ jobs: runs-on: ubuntu-22.04 container: ubuntu:23.10 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CC: clang CXX: clang++ diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 2f981041ed8..6b1eb30cb26 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -12,10 +12,21 @@ concurrency: jobs: skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest + name: Analyze PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} run_clang_tidy: strategy: matrix: @@ -24,17 +35,17 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 180 needs: skip_checks - if: ${{ github.event.pull_request.draft == false }} + if: ${{ github.event.pull_request.draft == 'false' }} steps: - name: Checkout code - if: ${{ needs.skip_checks.outputs.skip == false }} + if: ${{ needs.skip_checks.outputs.skip == 'false' }} uses: actions/checkout@v4 - name: Install dependencies - if: ${{ needs.skip_checks.outputs.skip == false }} + if: ${{ needs.skip_checks.outputs.skip == 'false' }} run: | .github/workflows/dependencies/clang15.sh - name: Set up cache - if: ${{ needs.skip_checks.outputs.skip == false }} + if: ${{ needs.skip_checks.outputs.skip == 'false' }} uses: actions/cache@v4 with: path: ~/.cache/ccache @@ -42,7 +53,7 @@ jobs: restore-keys: | ccache-${{ github.workflow }}-${{ github.job }}-git- - name: Build WarpX & run clang-tidy - if: ${{ needs.skip_checks.outputs.skip == false }} + if: ${{ needs.skip_checks.outputs.skip == 'false' }} run: | export CCACHE_COMPRESS=1 export CCACHE_COMPRESSLEVEL=10 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 26d13a24317..cd0b4443bb8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -14,15 +14,26 @@ concurrency: jobs: skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest + name: Analyze PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} analyze: name: Analyze runs-on: ubuntu-latest needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} permissions: actions: read contents: read diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml index 11c4942fd0c..f8c0e34a3b6 100644 --- a/.github/workflows/cuda.yml +++ b/.github/workflows/cuda.yml @@ -16,15 +16,26 @@ jobs: # https://github.com/ComputationalRadiationPhysics/picongpu/blob/0.5.0/share/picongpu/dockerfiles/ubuntu-1604/Dockerfile # https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest + name: Analyze PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} build_nvcc: name: NVCC 11.3 SP runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXXFLAGS: "-Werror" CMAKE_GENERATOR: Ninja @@ -99,7 +110,7 @@ jobs: name: NVCC 11.8.0 GNUmake runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -131,7 +142,7 @@ jobs: name: NVHPC@24.1 NVCC/NVC++ Release [tests] runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} #env: # # For NVHPC, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja diff --git a/.github/workflows/hip.yml b/.github/workflows/hip.yml index 36cc2a14d3c..444751fe908 100644 --- a/.github/workflows/hip.yml +++ b/.github/workflows/hip.yml @@ -12,10 +12,21 @@ concurrency: jobs: skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest + name: Analyze PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} build_hip_3d_sp: name: HIP 3D SP runs-on: ubuntu-20.04 @@ -23,7 +34,7 @@ jobs: CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed" CMAKE_GENERATOR: Ninja needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -78,7 +89,7 @@ jobs: CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed" CMAKE_GENERATOR: Ninja needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/insitu.yml b/.github/workflows/insitu.yml index a63c72bf59e..644639409a2 100644 --- a/.github/workflows/insitu.yml +++ b/.github/workflows/insitu.yml @@ -12,15 +12,26 @@ concurrency: jobs: skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest + name: Analyze PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} sensei: name: SENSEI runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXX: clang++ CC: clang @@ -47,7 +58,7 @@ jobs: name: Ascent runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXX: g++ CC: gcc @@ -88,7 +99,7 @@ jobs: name: Catalyst runs-on: ubuntu-22.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXX: g++ CC: gcc diff --git a/.github/workflows/intel.yml b/.github/workflows/intel.yml index 3f0d6e341e2..c9093856eb0 100644 --- a/.github/workflows/intel.yml +++ b/.github/workflows/intel.yml @@ -14,15 +14,26 @@ jobs: # Ref.: https://github.com/rscohn2/oneapi-ci # intel-basekit intel-hpckit are too large in size skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest + name: Analyze PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} build_icc: name: oneAPI ICC SP&DP runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} # For oneAPI, Ninja is slower than the default: #env: # CMAKE_GENERATOR: Ninja @@ -86,7 +97,7 @@ jobs: # For oneAPI, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -147,7 +158,7 @@ jobs: # For oneAPI, Ninja is slower than the default: # CMAKE_GENERATOR: Ninja needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 266035a4368..15342e5a4c8 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -24,8 +24,8 @@ cat check_diff.txt # Set paths to ignore paths_ignore=() paths_ignore+=("Docs/") -#paths_ignore+=(".github/") -#paths_ignore+=(".azure-pipelines.yml") +paths_ignore+=(".github/") +paths_ignore+=(".azure-pipelines.yml") echo "Paths to ignore:" echo ${paths_ignore[@]} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c6b7a7d2105..6b0e54944fa 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -12,15 +12,26 @@ concurrency: jobs: skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest + name: Analyze PR + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} build_cxxminimal: name: GCC Minimal w/o MPI runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXXFLAGS: "-Werror" steps: @@ -57,7 +68,7 @@ jobs: name: GCC 1D & 2D w/ MPI, QED tools runs-on: ubuntu-22.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXXFLAGS: "-Werror" CXX: "g++-12" @@ -101,7 +112,7 @@ jobs: name: GCC 3D & RZ w/ MPI, single precision runs-on: ubuntu-22.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CXX: "g++-12" CC: "gcc-12" @@ -145,7 +156,7 @@ jobs: name: GCC ABLASTR w/o MPI runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CMAKE_GENERATOR: Ninja CXXFLAGS: "-Werror" @@ -180,7 +191,7 @@ jobs: name: Clang pywarpx runs-on: ubuntu-20.04 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} env: CC: clang CXX: clang++ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 66a0a405342..e21c252a31c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -12,17 +12,28 @@ concurrency: jobs: skip_checks: - name: Analyze - uses: ./.github/workflows/skip_checks.yml - with: - runs-on: ubuntu-latest # does not need to be windows + name: Analyze PR + runs-on: ubuntu-latest # does not need to be Windows + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Skip checks? + run: | + .github/workflows/scripts/check_diff.sh \ + ${{ github.event.pull_request.head.ref }} \ + ${{ github.event.pull_request.base.ref }} \ + ${{ github.event.pull_request.head.repo.clone_url }} + outputs: + skip: ${{ env.SKIP_CHECKS }} build_win_msvc: name: MSVC C++17 w/o MPI runs-on: windows-latest needs: skip_checks # disabled due to issues in #5230 if: 0 - #if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + #if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -72,7 +83,7 @@ jobs: name: Clang C++17 w/ OMP w/o MPI runs-on: windows-2019 needs: skip_checks - if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == false }} + if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} steps: - name: Checkout code uses: actions/checkout@v4 From 44b99c06b5e4c8b18e24e71354a0ee98ed8d3a2e Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 15:09:37 -0800 Subject: [PATCH 48/51] Remove obsolete file --- .github/workflows/skip_checks.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/skip_checks.yml diff --git a/.github/workflows/skip_checks.yml b/.github/workflows/skip_checks.yml deleted file mode 100644 index dd4e1970d74..00000000000 --- a/.github/workflows/skip_checks.yml +++ /dev/null @@ -1,26 +0,0 @@ -on: - workflow_call: - inputs: - runs-on: - description: "Type of machine to run on" - required: true - type: string -jobs: - skip_checks: - name: Skip - runs-on: ${{ inputs.runs-on }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Analyze PR - run: | - .github/workflows/scripts/check_diff.sh \ - ${{ github.event.pull_request.head.ref }} \ - ${{ github.event.pull_request.base.ref }} \ - ${{ github.event.pull_request.head.repo.clone_url }} - - name: Debug - run: echo "env.SKIP_CHECKS=${{ env.SKIP_CHECKS }}" - outputs: - skip: ${{ env.SKIP_CHECKS }} From 4dbe458f70e39182fe26933f5eb642f648bd1b5a Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 15:13:13 -0800 Subject: [PATCH 49/51] Fix clang tidy workflow --- .github/workflows/clang_tidy.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 6b1eb30cb26..e5418b0ee62 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 180 needs: skip_checks - if: ${{ github.event.pull_request.draft == 'false' }} + if: ${{ github.event.pull_request.draft == false }} steps: - name: Checkout code if: ${{ needs.skip_checks.outputs.skip == 'false' }} @@ -63,16 +63,16 @@ jobs: ccache -z export CXX=$(which clang++-15) export CC=$(which clang-15) - cmake -S . -B build_clang_tidy \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DWarpX_DIMS="${{ matrix.dim }}" \ - -DWarpX_MPI=ON \ - -DWarpX_COMPUTE=OMP \ - -DWarpX_FFT=ON \ - -DWarpX_QED=ON \ - -DWarpX_QED_TABLE_GEN=ON \ - -DWarpX_OPENPMD=ON \ - -DWarpX_PRECISION=SINGLE \ + cmake -S . -B build_clang_tidy \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DWarpX_DIMS="${{ matrix.dim }}" \ + -DWarpX_MPI=ON \ + -DWarpX_COMPUTE=OMP \ + -DWarpX_FFT=ON \ + -DWarpX_QED=ON \ + -DWarpX_QED_TABLE_GEN=ON \ + -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 From 6636191a818717ab280f2b9c76d56990d1df05c4 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 15:27:18 -0800 Subject: [PATCH 50/51] Clean up --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cd0b4443bb8..26ea58cf285 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -30,7 +30,7 @@ jobs: outputs: skip: ${{ env.SKIP_CHECKS }} analyze: - name: Analyze + name: Query code runs-on: ubuntu-latest needs: skip_checks if: ${{ github.event.pull_request.draft == false && needs.skip_checks.outputs.skip == 'false' }} From 7a5e040473d8d5a51b1e4d3f74643cbf4ba9d5da Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Tue, 19 Nov 2024 15:33:49 -0800 Subject: [PATCH 51/51] Reset paths to ignore --- .github/workflows/scripts/check_diff.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/check_diff.sh b/.github/workflows/scripts/check_diff.sh index 15342e5a4c8..d6b41ee4fc8 100755 --- a/.github/workflows/scripts/check_diff.sh +++ b/.github/workflows/scripts/check_diff.sh @@ -21,15 +21,13 @@ git diff --name-only --diff-filter=ACMRTUXB origin/${base_ref}..fork/${head_ref} echo "Files changed:" cat check_diff.txt -# Set paths to ignore +# Set paths to ignore (please test grep command below when adding new patterns) paths_ignore=() paths_ignore+=("Docs/") -paths_ignore+=(".github/") -paths_ignore+=(".azure-pipelines.yml") echo "Paths to ignore:" echo ${paths_ignore[@]} -# Set string for grep command +# Set string for regular expression to grep paths_ignore_string=$(IFS='|'; echo "${paths_ignore[*]}") # Set skip variable after inspecting files changed