Skip to content

Commit c28d48f

Browse files
committed
Workflows: add workflow files for eamxx standalone and v1 testing
1 parent eb6ce89 commit c28d48f

File tree

2 files changed

+248
-0
lines changed

2 files changed

+248
-0
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: EAMxx standalone testing
2+
3+
on:
4+
# Runs on PRs against master
5+
pull_request:
6+
branches: [ master ]
7+
types: [opened, synchronize, ready_for_review, reopened]
8+
9+
# Manual run is used to bless
10+
workflow_dispatch:
11+
inputs:
12+
jobs_list:
13+
description: 'Job to run'
14+
required: true
15+
type: choice
16+
options:
17+
- gcc-openmp
18+
bless:
19+
description: 'Generate baselines'
20+
required: true
21+
type: boolean
22+
23+
# Add schedule trigger for nightly runs at midnight MT (Standard Time)
24+
# schedule:
25+
# - cron: '0 7 * * *' # Runs at 7 AM UTC, which is midnight MT during Standard Time
26+
27+
concurrency:
28+
# Two runs are in the same group if:
29+
# - they have the same trigger
30+
# - if trigger=pull_request, the PR number must match
31+
# - if trigger=workflow_dispatch, the inputs are the same
32+
group: ${{ github.workflow }}-${{ github.event_name }}-${{
33+
github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id
34+
}}
35+
cancel-in-progress: true
36+
37+
jobs:
38+
gcc-openmp:
39+
runs-on: [self-hosted, ghci-snl-cpu, gcc]
40+
strategy:
41+
fail-fast: true
42+
matrix:
43+
build_type: [sp, dbg, fpe, opt]
44+
# Run this workflow if:
45+
# - workflow_dispatch: user requested this job.
46+
# - schedule: always:
47+
# - pull_request: matching skip label is NOT found
48+
if: |
49+
${{
50+
github.event_name == 'schedule' ||
51+
( github.event_name == 'workflow_dispatch' && github.event.inputs.jobs_list == 'gcc-openmp' ) ||
52+
(
53+
github.event_name == 'pull_request' &&
54+
!(
55+
contains(github.event.pull_request.labels.*.name, 'AT: skip gcc-openmp') ||
56+
contains(github.event.pull_request.labels.*.name, 'AT: skip standalone')
57+
)
58+
)
59+
}}
60+
name: gcc-openmp-${{ matrix.build_type }}
61+
steps:
62+
- name: Show action trigger
63+
uses: actions/github-script@v7
64+
with:
65+
script: |
66+
const eventName = context.eventName;
67+
const eventAction = context.payload.action || 'N/A';
68+
const actor = context.actor;
69+
console.log(`The job was triggered by a ${eventName} event.`);
70+
console.log(` - Event action: ${eventAction}`);
71+
console.log(` - Triggered by: ${actor}`);
72+
- name: Check out the repository
73+
uses: actions/checkout@v4
74+
with:
75+
persist-credentials: false
76+
show-progress: false
77+
submodules: recursive
78+
- name: Set test-all inputs based on event specs
79+
run: |
80+
echo "submit=false" >> $GITHUB_ENV
81+
echo "generate=false" >> $GITHUB_ENV
82+
if [ "${{ github.event_name }}" == "schedule" ]; then
83+
echo "submit=true" >> $GITHUB_ENV
84+
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
85+
if [ "${{ inputs.bless }}" == "true" ]; then
86+
echo "generate=true" >> $GITHUB_ENV
87+
fi
88+
fi
89+
- name: Run tests
90+
uses: ./.github/actions/test-all-scream
91+
with:
92+
build_type: ${{ matrix.build_type }}
93+
machine: ghci-snl-cpu
94+
generate: ${{ env.generate }}
95+
submit: ${{ env.submit }}
96+
cmake-configs: Kokkos_ENABLE_OPENMP=ON
97+
# cuda:
98+
# # Disable until the CUDA container is up and running. When CUDA container is availabe, remove
99+
# # this line and uncomment the next if
100+
# if: false
101+
# # Runs always for pull_request. For workflow_dispatch, user must request this machine
102+
# # if: ${{ github.event_name == 'pull_request' || contains(github.event.inputs.jobs_to_run, 'openmp-gcc') }}
103+
# runs-on: [self-hosted, cuda]
104+
# strategy:
105+
# fail-fast: false
106+
# matrix:
107+
# build_type: [sp, dbg, fpe, opt]
108+
# name: cuda-${{ matrix.build_type }}
109+
# steps:
110+
# - name: Show action trigger
111+
# uses: ./.github/actions/print-workflow-trigger
112+
# - name: Check out the repository
113+
# uses: actions/checkout@v4
114+
# with:
115+
# persist-credentials: false
116+
# show-progress: false
117+
# submodules: recursive
118+
# - name: Run tests
119+
# uses: ./.github/actions/test-all-scream
120+
# with:
121+
# build_type: ${{ matrix.build_type }}
122+
# machine: ghci-snl-cuda
123+
# run_type: at-run
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: EAMxx v1 CI testing
2+
3+
on:
4+
# Runs on PRs against master
5+
pull_request:
6+
branches: [ master ]
7+
types: [opened, synchronize, ready_for_review, reopened]
8+
9+
# Manual run is used to bless
10+
workflow_dispatch:
11+
inputs:
12+
jobs_list:
13+
description: 'Job to run'
14+
required: true
15+
type: choice
16+
options:
17+
- cpu-gcc
18+
bless:
19+
description: 'Generate baselines'
20+
required: true
21+
type: boolean
22+
23+
concurrency:
24+
# Two runs are in the same group if:
25+
# - they have the same trigger
26+
# - if trigger=pull_request, the PR number must match
27+
# - if trigger=workflow_dispatch, the inputs are the same
28+
group: ${{ github.workflow }}-${{ github.event_name }}-${{
29+
github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id
30+
}}
31+
cancel-in-progress: true
32+
33+
jobs:
34+
cpu-gcc:
35+
runs-on: [self-hosted, gcc, ghci-snl-cpu]
36+
strategy:
37+
matrix:
38+
test:
39+
- ERS_Ln9.ne4_ne4.F2000-SCREAMv1-AQP1.ghci-snl-cpu_gnu.scream-output-preset-2
40+
- ERS_P16_Ln22.ne30pg2_ne30pg2.FIOP-SCREAMv1-DP.ghci-snl-cpu_gnu.scream-dpxx-arm97
41+
- ERS_Ln22.ne4pg2_ne4pg2.F2010-SCREAMv1.ghci-snl-cpu_gnu.scream-small_kernels--scream-output-preset-5
42+
fail-fast: false
43+
# Run this workflow if:
44+
# - workflow_dispatch: user requested this job.
45+
# - schedule: always:
46+
# - pull_request: matching skip label is NOT found
47+
if: |
48+
${{
49+
github.event_name == 'schedule' ||
50+
( github.event_name == 'workflow_dispatch' && contains(github.event.inputs.jobs_list, 'gcc-openmp') ) ||
51+
(
52+
github.event_name == 'pull_request' &&
53+
!(
54+
contains(github.event.pull_request.labels.*.name, 'AT: skip gcc') ||
55+
contains(github.event.pull_request.labels.*.name, 'AT: skip v1')
56+
)
57+
)
58+
}}
59+
steps:
60+
- name: Show action trigger
61+
uses: actions/github-script@v7
62+
with:
63+
script: |
64+
const eventName = context.eventName;
65+
const eventAction = context.payload.action || 'N/A';
66+
const actor = context.actor;
67+
console.log(`The job was triggered by a ${eventName} event.`);
68+
console.log(` - Event action: ${eventAction}`);
69+
console.log(` - Triggered by: ${actor}`);
70+
- name: Set CA certificates env var
71+
run: |
72+
# Ensure the operating system is Linux
73+
if [ "$(uname)" != "Linux" ]; then
74+
echo "This action only supports Linux."
75+
exit 1
76+
fi
77+
# Set env var to be used in upload-artifacts phase
78+
if [ -f /etc/debian_version ]; then
79+
echo "NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt" >> $GITHUB_ENV
80+
elif [ -f /etc/redhat-release ] || [ -f /etc/centos-release ] || [ -f /etc/fedora-release ]; then
81+
echo "NODE_EXTRA_CA_CERTS=/etc/pki/tls/certs/ca-bundle.crt" >> $GITHUB_ENV
82+
else
83+
echo "Unsupported Linux distribution"
84+
exit 1
85+
fi
86+
- name: Establish cmp/gen flag
87+
run: |
88+
dir_suffix=".C"
89+
cmp_gen_flag="-c"
90+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
91+
if [ ${{ inputs.bless }} ]; then
92+
cmp_gen_flag="-o -g"
93+
dir_suffix=".G"
94+
fi
95+
fi
96+
echo "flags=$cmp_gen_flag -b master" >> $GITHUB_ENV
97+
echo "folder_suffix=$dir_suffix" >> $GITHUB_ENV
98+
- name: Check out the repository
99+
uses: actions/checkout@v4
100+
with:
101+
persist-credentials: false
102+
show-progress: false
103+
submodules: recursive
104+
- name: Run test
105+
run: |
106+
./cime/scripts/create_test ${{ matrix.test }} ${{ env.flags }} --wait
107+
- name: Upload case files
108+
if: ${{ always() }}
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: ${{ matrix.test }}
112+
path: |
113+
/projects/e3sm/scratch/${{ matrix.test }}${{ env.folder_suffix }}*/TestStatus.log
114+
/projects/e3sm/scratch/${{ matrix.test }}${{ env.folder_suffix }}*/bld/*.bldlog.*
115+
/projects/e3sm/scratch/${{ matrix.test }}${{ env.folder_suffix }}*/bld/case2bld/*.bldlog.*
116+
/projects/e3sm/scratch/${{ matrix.test }}${{ env.folder_suffix }}*/run/*.log.*
117+
/projects/e3sm/scratch/${{ matrix.test }}${{ env.folder_suffix }}*/run/case2run/*.log.*
118+
/projects/e3sm/scratch/${{ matrix.test }}${{ env.folder_suffix }}*/run/*.cprnc.out
119+
/projects/e3sm/scratch/${{ matrix.test }}${{ env.folder_suffix }}*/run/case2run/*.cprnc.out
120+
env:
121+
NODE_EXTRA_CA_CERTS: ${{ env.NODE_EXTRA_CA_CERTS }}
122+
- name: Clean up
123+
if: ${{ always() }}
124+
run: |
125+
rm -rf /projects/e3sm/scratch/${{ matrix.test }}*

0 commit comments

Comments
 (0)