Skip to content

Commit

Permalink
Skip some CIs if only Docs/ has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Oct 23, 2024
1 parent 8f4fbaf commit 86775c2
Show file tree
Hide file tree
Showing 17 changed files with 179 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml

castro:
name: Castro
runs-on: ubuntu-latest
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Get Latest Release Tag
Expand Down Expand Up @@ -62,6 +67,8 @@ jobs:
warpx:
name: WarpX
runs-on: ubuntu-latest
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Download WarpX
Expand Down Expand Up @@ -105,7 +112,8 @@ jobs:
pyamrex:
name: pyamrex
runs-on: ubuntu-latest
steps:
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
- uses: actions/checkout@v4
- name: Checkout pyamrex
uses: actions/checkout@v4
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/bittree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml

bittree-2d:
name: Bittree 2D
runs-on: ubuntu-latest
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -62,6 +67,8 @@ jobs:
bittree-3d:
name: Bittree 3D
runs-on: ubuntu-latest
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/catalyst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml

catalyst:
name: Catalyst
runs-on: ubuntu-22.04
if: github.event.pull_request.draft == false
needs: check_changes
if: github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true'
env:
CXX: g++
CC: gcc
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/check_changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check Changes

on:
workflow_call:
outputs:
has_docs_changes:
value: ${{ jobs.check.outputs.has_docs_changes }}
has_non_docs_changes:
value: ${{ jobs.check.outputs.has_non_docs_changes }}

jobs:
check:
runs-on: ubuntu-latest
outputs:
has_non_docs_changes: ${{ steps.set-output.outputs.has_non_docs_changes }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
docs:
- 'Docs/**'
others:
- '!Docs/**'
- id: set-output
run: |
echo "has_docs_changes=${{ steps.changes.outputs.docs }}" >> $GITHUB_OUTPUT
echo "has_non_docs_changes=${{ steps.changes.outputs.others }}" >> $GITHUB_OUTPUT
13 changes: 11 additions & 2 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -Wno-c++17-extensions: Clang complains about nodiscard if the standard is not set to c++17.

name: LinuxClang

on: [push, pull_request]
Expand All @@ -9,11 +7,16 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml

# Build and install libamrex as AMReX CMake project
# Note: this is an intentional "minimal" build that does not enable (many) options
library_clang:
name: [email protected] C++17 SP NOMPI Debug [lib]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -75,6 +78,8 @@ jobs:
tests_clang:
name: [email protected] C++17 SP Particles DP Mesh Debug [tests]
runs-on: ubuntu-22.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -131,6 +136,8 @@ jobs:
tests_cxx20:
name: Clang C++20 [tests]
runs-on: ubuntu-22.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -180,6 +187,8 @@ jobs:
configure-2d:
name: Clang NOMPI Release [configure 2D]
runs-on: ubuntu-22.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml

analyze:
if: ${{ github.repository == 'AMReX-Codes/amrex' || github.event_name != 'schedule' }}
needs: check_changes
if: ${{ github.repository == 'AMReX-Codes/amrex' || github.event_name != 'schedule' }} && needs.check_changes.outputs.has_non_docs_changes == 'true'
name: Analyze
runs-on: ubuntu-latest
permissions:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml

# Build libamrex and all tests with CUDA 11.2
tests-cuda11:
name: [email protected] [email protected] C++17 Release [tests]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -62,6 +67,8 @@ jobs:
tests-cuda11-clang:
name: Clang@15 [email protected] C++17 Release [tests]
runs-on: ubuntu-22.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
env:
CC: clang-15
CXX: clang++-15
Expand Down Expand Up @@ -115,6 +122,8 @@ jobs:
tests-nvhpc-nvcc:
name: NVHPC NVCC/NVC++ C++17 Release [tests]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -178,6 +187,8 @@ jobs:
configure-3d-cuda:
name: [email protected] [email protected] [configure 3D]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml

# Build and install libamrex as AMReX CMake project
# Note: this is an intentional "minimal" build that does not enable (many) options
library:
name: [email protected] C++17 Release [lib]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -72,6 +77,8 @@ jobs:
tests_build_3D:
name: GNU@13 C++17 3D Debug Fortran [tests]
runs-on: ubuntu-24.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -121,6 +128,8 @@ jobs:
tests_build_2D:
name: [email protected] C++17 2D Debug Fortran [tests]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -170,6 +179,8 @@ jobs:
tests_build_1D:
name: [email protected] C++17 1D Debug Fortran [tests]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -221,6 +232,8 @@ jobs:
tests_cxx20:
name: [email protected] C++20 OMP [tests]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -281,6 +294,8 @@ jobs:
tests-nonmpi:
name: [email protected] C++17 NOMPI [tests]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -340,6 +355,8 @@ jobs:
tests-nofortran:
name: GNU@12 C++17 w/o Fortran [tests]
runs-on: ubuntu-22.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -401,6 +418,8 @@ jobs:
configure-1d:
name: [email protected] Release [configure 1D]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -441,6 +460,8 @@ jobs:
configure-3d:
name: [email protected] Release [configure 3D]
runs-on: ubuntu-22.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -481,6 +502,8 @@ jobs:
configure-3d-single-tprof:
name: [email protected] Release [configure 3D]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -522,6 +545,8 @@ jobs:
configure-3d-omp-debug:
name: [email protected] OMP Debug [configure 3D]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -562,6 +587,8 @@ jobs:
plotfile-tools:
name: GNU Plotfile Tools [tools]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -601,6 +628,8 @@ jobs:
tests_run:
name: GNU@13 C++17 [tests]
runs-on: ubuntu-24.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -651,6 +680,8 @@ jobs:
test_hdf5:
name: [email protected] HDF5 I/O Test [tests]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
env:
CXX: h5pcc
CC: h5cc
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/hip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ concurrency:
cancel-in-progress: true

jobs:
check_changes:
uses: ./.github/workflows/check_changes.yml

tests-hip:
name: HIP ROCm Flang C++17 [tests]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -69,6 +74,8 @@ jobs:
tests-hip-wrapper:
name: HIP ROCm [email protected] C++17 [tests-hipcc]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -127,6 +134,8 @@ jobs:
configure-2d-single-hip:
name: HIP EB [configure 2D]
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down Expand Up @@ -160,6 +169,8 @@ jobs:
hip-3d-eb-gmake:
name: HIP EB 3D GMake
runs-on: ubuntu-20.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v4
- name: Dependencies
Expand Down
Loading

0 comments on commit 86775c2

Please sign in to comment.