Skip to content

Commit b8c8794

Browse files
EZoniAndrew Myers
authored andcommitted
CI: Fix Skipped Required Workflows (BLAST-WarpX#5889)
This implement AMReX's solution to handle skipped but required CI workflows properly, as in AMReX-Codes/amrex#4197. This is necessary due to the limitation described in https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks. PR BLAST-WarpX#5469 implements an alternative solution based on a in-house script, but I figured it may be easier to implement the same solution as in AMReX for maintenance purposes. The new preliminary jobs are named `Analyze / Check changes`. For example, they show up as `CUDA / Analyze / Check changes`, `macOS / Analyze / Check changes`, etc. This will allow all TC members to merge PRs where required workflows are skipped (e.g., PRs that change only documentation files), instead of relying on the WarpX admin team only.
1 parent a0621b2 commit b8c8794

File tree

12 files changed

+135
-59
lines changed

12 files changed

+135
-59
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Changes
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
has_non_docs_changes:
7+
value: ${{ jobs.check.outputs.has_non_docs_changes }}
8+
9+
jobs:
10+
check:
11+
name: Check changes
12+
runs-on: ubuntu-latest
13+
outputs:
14+
has_non_docs_changes: ${{ steps.set-output.outputs.has_non_docs_changes }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: dorny/paths-filter@v3
18+
id: changes
19+
with:
20+
filters: |
21+
non_docs:
22+
- '!Docs/**'
23+
- '!**.md'
24+
- '!**.rst'
25+
predicate-quantifier: 'every'
26+
- id: set-output
27+
run: |
28+
echo "has_non_docs_changes=${{ steps.changes.outputs.non_docs }}" >> $GITHUB_OUTPUT

.github/workflows/clang_sanitizers.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-clangsanitizers
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
build_UB_sanitizer:
1820
name: Clang UB sanitizer
1921
runs-on: ubuntu-24.04
20-
if: github.event.pull_request.draft == false
22+
needs: check_changes
23+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2124
env:
2225
CC: clang
2326
CXX: clang++
@@ -79,7 +82,8 @@ jobs:
7982
build_thread_sanitizer:
8083
name: Clang thread sanitizer
8184
runs-on: ubuntu-24.04
82-
if: github.event.pull_request.draft == false
85+
needs: check_changes
86+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
8387
env:
8488
CC: clang
8589
CXX: clang++

.github/workflows/clang_tidy.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,26 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-clangtidy
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
run_clang_tidy:
1820
strategy:
1921
matrix:
2022
dim: [1, 2, RZ, 3]
2123
name: clang-tidy-${{ matrix.dim }}D
2224
runs-on: ubuntu-24.04
2325
timeout-minutes: 250
24-
if: github.event.pull_request.draft == false
26+
needs: check_changes
27+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2528
steps:
2629
- uses: actions/checkout@v4
2730
- name: install dependencies

.github/workflows/cuda.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-cuda
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
build_nvcc:
1820
name: NVCC SP
1921
runs-on: ubuntu-22.04
20-
if: github.event.pull_request.draft == false
22+
needs: check_changes
23+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2124
env:
2225
CXXFLAGS: "-Werror"
2326
CMAKE_GENERATOR: Ninja
@@ -98,7 +101,8 @@ jobs:
98101
build_nvcc_gnumake:
99102
name: NVCC GNU Make
100103
runs-on: ubuntu-22.04
101-
if: github.event.pull_request.draft == false
104+
needs: check_changes
105+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
102106
steps:
103107
- uses: actions/checkout@v4
104108
- name: install dependencies
@@ -132,7 +136,8 @@ jobs:
132136
build_nvhpc:
133137
name: NVHPC
134138
runs-on: ubuntu-24.04
135-
if: github.event.pull_request.draft == false
139+
needs: check_changes
140+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
136141
#env:
137142
# # For NVHPC, Ninja is slower than the default:
138143
# CMAKE_GENERATOR: Ninja

.github/workflows/hip.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-hip
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
build_hip_3d_sp:
1820
name: HIP 3D SP
1921
runs-on: ubuntu-24.04
2022
env:
2123
CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed"
2224
CMAKE_GENERATOR: Ninja
23-
if: github.event.pull_request.draft == false
25+
needs: check_changes
26+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2427
steps:
2528
- uses: actions/checkout@v4
2629
- name: install dependencies
@@ -74,7 +77,8 @@ jobs:
7477
env:
7578
CXXFLAGS: "-Werror -Wno-deprecated-declarations -Wno-error=pass-failed"
7679
CMAKE_GENERATOR: Ninja
77-
if: github.event.pull_request.draft == false
80+
needs: check_changes
81+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
7882
steps:
7983
- uses: actions/checkout@v4
8084
- name: install dependencies

.github/workflows/insitu.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-insituvis
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
sensei:
1820
name: SENSEI
1921
runs-on: ubuntu-24.04
20-
if: github.event.pull_request.draft == false
22+
needs: check_changes
23+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2124
env:
2225
CXX: clang++
2326
CC: clang
@@ -43,7 +46,8 @@ jobs:
4346
ascent:
4447
name: Ascent
4548
runs-on: ubuntu-24.04
46-
if: github.event.pull_request.draft == false
49+
needs: check_changes
50+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
4751
env:
4852
CXX: g++
4953
CC: gcc
@@ -83,7 +87,8 @@ jobs:
8387
catalyst:
8488
name: Catalyst
8589
runs-on: ubuntu-24.04
86-
if: github.event.pull_request.draft == false
90+
needs: check_changes
91+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
8792
env:
8893
CXX: g++
8994
CC: gcc

.github/workflows/intel.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-intel
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
build_icpx:
1820
name: oneAPI ICX SP
1921
runs-on: ubuntu-24.04
@@ -24,7 +26,8 @@ jobs:
2426
CXXFLAGS: "-Werror -Wno-error=pass-failed -Wno-tautological-constant-compare"
2527
# For oneAPI, Ninja is slower than the default:
2628
# CMAKE_GENERATOR: Ninja
27-
if: github.event.pull_request.draft == false
29+
needs: check_changes
30+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2831
steps:
2932
- uses: actions/checkout@v4
3033
- name: install dependencies
@@ -89,7 +92,8 @@ jobs:
8992
CXXFLAGS: "-Werror -Wno-tautological-constant-compare"
9093
# For oneAPI, Ninja is slower than the default:
9194
# CMAKE_GENERATOR: Ninja
92-
if: github.event.pull_request.draft == false
95+
needs: check_changes
96+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
9397
steps:
9498
- uses: actions/checkout@v4
9599
- name: install dependencies

.github/workflows/jupyter.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-jupyter
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
jupyter_notebooks:
1820
name: Notebooks
1921
runs-on: ubuntu-latest
20-
if: github.event.pull_request.draft == false
22+
needs: check_changes
23+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2124
steps:
2225
- uses: actions/checkout@v4
2326
- name: Set up Python

.github/workflows/macos.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-macos
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
build_appleclang:
1820
name: AppleClang
1921
runs-on: macos-latest
20-
if: github.event.pull_request.draft == false
22+
needs: check_changes
23+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2124
env:
2225
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE
2326
# For macOS, Ninja is slower than the default:

.github/workflows/petsc.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ on:
55
branches:
66
- "development"
77
pull_request:
8-
paths-ignore:
9-
- "Docs/**"
10-
- "**.rst"
118

129
concurrency:
1310
group: ${{ github.ref }}-${{ github.head_ref }}-petsc
1411
cancel-in-progress: true
1512

1613
jobs:
14+
15+
check_changes:
16+
name: Analyze
17+
uses: ./.github/workflows/check_changes.yml
18+
1719
test-petsc-gcc:
1820
name: GCC
1921
runs-on: ubuntu-latest
20-
if: github.event.pull_request.draft == false
22+
needs: check_changes
23+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
2124
env:
2225
CXXFLAGS: "-Werror"
2326
steps:
@@ -72,7 +75,8 @@ jobs:
7275
test-petsc-mpich:
7376
name: GCC-12 + MPICH
7477
runs-on: ubuntu-latest
75-
if: github.event.pull_request.draft == false
78+
needs: check_changes
79+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
7680
env:
7781
CXXFLAGS: "-Werror"
7882
steps:
@@ -127,7 +131,8 @@ jobs:
127131
test-petsc-gcc-debug:
128132
name: GCC [Debug]
129133
runs-on: ubuntu-latest
130-
if: github.event.pull_request.draft == false
134+
needs: check_changes
135+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
131136
env:
132137
CXXFLAGS: "-Werror"
133138
steps:
@@ -185,7 +190,8 @@ jobs:
185190
test-petsc-mpich-debug:
186191
name: GCC-12 + MPICH [Debug]
187192
runs-on: ubuntu-latest
188-
if: github.event.pull_request.draft == false
193+
needs: check_changes
194+
if: ${{ github.event.pull_request.draft == false && needs.check_changes.outputs.has_non_docs_changes == 'true' }}
189195
env:
190196
CXXFLAGS: "-Werror"
191197
steps:

0 commit comments

Comments
 (0)