5
5
pull_request :
6
6
branches : [ master ]
7
7
types : [opened, synchronize, ready_for_review, reopened]
8
- paths :
9
- - components/eamxx/**
10
- - components/eam/src/physics/rrtmgp/**
11
- - components/eam/src/physics/p3/scream/**
12
- - components/eam/src/physics/cam/**
13
- - .github/workflows/eamxx-standalone-testing.yml
14
- - externals/ekat/**
15
- - externals/scorpio/**
16
- - externals/haero/**
17
- - externals/YAKL/**
18
- - components/eam/src/physics/rrtmgp/external/**
19
8
20
9
# Manual run is used to bless
21
10
workflow_dispatch :
48
37
submit : ${{ github.event_name == 'schedule' && 'true' || 'false' }} # Submit to cdash only for nightlies
49
38
50
39
jobs :
40
+ pr_relevant :
41
+ if : ${{ github.event_name == 'pull_request' }}
42
+ runs-on : ubuntu-latest # This job can run anywhere
43
+ outputs :
44
+ value : ${{ steps.check_paths.outputs.touched }}
45
+ steps :
46
+ - name : check_paths
47
+ run : |
48
+ paths=(
49
+ components/eamxx
50
+ components/eam/src/physics/rrtmgp
51
+ components/eam/src/physics/p3/scream
52
+ components/eam/src/physics/cam
53
+ components/eam/src/physics/rrtmgp/external
54
+ externals/ekat
55
+ externals/scorpio
56
+ externals/haero
57
+ externals/YAKL
58
+ .github/workflows/eamxx-sa-testing.yml
59
+ )
60
+ pattern=$(IFS=\|; echo "${paths[*]}")
61
+
62
+ # Use the GitHub API to get the list of changed files
63
+ response=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
64
+ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.number }}/files")
65
+ changed_files=$(echo "$response" | grep -o '"filename": *"[^"]*"' | sed 's/"filename": *//; s/"//g')
66
+
67
+ # Check for matches and echo the matching files (or "" if none)
68
+ matching_files=$(echo "$changed_files" | grep -E "^($pattern)" || echo "")
69
+ if [[ -n "$matching_files" ]]; then
70
+ echo "Found relevant files: $matching_files"
71
+ echo "touched=true" >> $GITHUB_OUTPUT
72
+ else
73
+ echo "No relevant files touched by this PR."
74
+ echo "touched=false" >> $GITHUB_OUTPUT
75
+ fi
76
+ get_labels :
77
+ if : ${{ github.event_name == 'pull_request' }}
78
+ runs-on : ubuntu-latest
79
+ outputs :
80
+ labels : ${{ steps.get_labels.outputs.labels }}
81
+ steps :
82
+ - name : get_labels
83
+ run : |
84
+ labels="${{ join(github.event.pull_request.labels.*.name, ',') }}"
85
+ echo "labels=${labels}" >> $GITHUB_OUTPUT
51
86
gcc-openmp :
87
+ needs : pr_relevant, get_labels
88
+ if : |
89
+ (github.event_name == 'pull_request' &&
90
+ needs.pr_relevant.outputs.value=='true' &&
91
+ !contains(needs.get_labels.outputs.labels,'CI: skip gcc') &&
92
+ !contains(needs.get_labels.outputs.labels,'CI: skip openmp') &&
93
+ !contains(needs.get_labels.outputs.labels,'CI: skip eamxx-sa') &&
94
+ !contains(needs.get_labels.outputs.labels,'CI: skip eamxx-all')) ||
95
+ (github.event_name == 'workflow_dispatch' &&
96
+ github.event.inputs.job_to_run == 'gcc-openmp' ||
97
+ github.event.inputs.job_to_run == 'all') ||
98
+ github.event_name == 'schedule'
52
99
runs-on : [self-hosted, ghci-snl-cpu, gcc]
53
100
strategy :
54
101
fail-fast : false
55
102
matrix :
56
103
build_type : [sp, dbg, fpe, opt]
57
- if : ${{ github.event_name != 'workflow_dispatch' ||
58
- github.event.inputs.job_to_run == 'gcc-openmp' ||
59
- github.event.inputs.job_to_run == 'all' }}
60
104
name : gcc-openmp / ${{ matrix.build_type }}
61
105
steps :
62
106
- name : Check out the repository
@@ -67,13 +111,6 @@ jobs:
67
111
submodules : recursive
68
112
- name : Show action trigger
69
113
uses : ./.github/actions/show-workflow-trigger
70
- - name : Check for skip labels
71
- if : ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_review' }}
72
- uses : ./.github/actions/check-skip-labels
73
- with :
74
- skip_labels : ' AT: skip gcc,AT: skip openmp,AT: skip eamxx-sa,AT: skip eamxx-all'
75
- token : ${{ secrets.GITHUB_TOKEN }}
76
- pr_number : ${{ github.event.pull_request.number }}
77
114
- name : Set test-all inputs based on event specs
78
115
run : |
79
116
echo "generate=false" >> $GITHUB_ENV
@@ -91,14 +128,23 @@ jobs:
91
128
submit : ${{ env.submit }}
92
129
cmake-configs : Kokkos_ENABLE_OPENMP=ON
93
130
gcc-cuda :
131
+ needs : pr_relevant, get_labels
132
+ if : |
133
+ (github.event_name == 'pull_request' &&
134
+ needs.pr_relevant.outputs.value=='true' &&
135
+ !contains(needs.get_labels.outputs.labels,'CI: skip gcc') &&
136
+ !contains(needs.get_labels.outputs.labels,'CI: skip cuda') &&
137
+ !contains(needs.get_labels.outputs.labels,'CI: skip eamxx-sa') &&
138
+ !contains(needs.get_labels.outputs.labels,'CI: skip eamxx-all')) ||
139
+ (github.event_name == 'workflow_dispatch' &&
140
+ github.event.inputs.job_to_run == 'gcc-cuda' ||
141
+ github.event.inputs.job_to_run == 'all') ||
142
+ github.event_name == 'schedule'
94
143
runs-on : [self-hosted, ghci-snl-cuda, cuda, gcc]
95
144
strategy :
96
145
fail-fast : false
97
146
matrix :
98
147
build_type : [sp, dbg, opt]
99
- if : ${{ github.event_name != 'workflow_dispatch' ||
100
- github.event.inputs.job_to_run == 'gcc-cuda' ||
101
- github.event.inputs.job_to_run == 'all' }}
102
148
name : gcc-cuda / ${{ matrix.build_type }}
103
149
steps :
104
150
- name : Check out the repository
@@ -109,13 +155,6 @@ jobs:
109
155
submodules : recursive
110
156
- name : Show action trigger
111
157
uses : ./.github/actions/show-workflow-trigger
112
- - name : Check for skip labels
113
- if : ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_review' }}
114
- uses : ./.github/actions/check-skip-labels
115
- with :
116
- skip_labels : ' AT: skip gcc,AT: skip cuda,AT: skip eamxx-sa,AT: skip eamxx-all'
117
- token : ${{ secrets.GITHUB_TOKEN }}
118
- pr_number : ${{ github.event.pull_request.number }}
119
158
- name : Set test-all inputs based on event specs
120
159
run : |
121
160
echo "generate=false" >> $GITHUB_ENV
0 commit comments