forked from E3SM-Project/scream
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (118 loc) · 4.26 KB
/
eamxx-standalone-testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: eamxx-sa
on:
# Runs on PRs against master
pull_request:
branches: [ master ]
types: [opened, synchronize, ready_for_review, reopened]
# Manual run is used to bless
workflow_dispatch:
inputs:
jobs_list:
description: 'Job to run'
required: true
type: choice
options:
- gcc-openmp
bless:
description: 'Generate baselines'
required: true
type: boolean
# Add schedule trigger for nightly runs at midnight MT (Standard Time)
# schedule:
# - cron: '0 7 * * *' # Runs at 7 AM UTC, which is midnight MT during Standard Time
concurrency:
# Two runs are in the same group if:
# - they have the same trigger
# - if trigger=pull_request, the PR number must match
# - if trigger=workflow_dispatch, the inputs are the same
group: ${{ github.workflow }}-${{ github.event_name }}-${{
github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id
}}
cancel-in-progress: true
jobs:
gcc-openmp:
runs-on: [self-hosted, ghci-snl-cpu, gcc]
strategy:
fail-fast: true
matrix:
build_type: [sp, dbg, fpe, opt]
# Run this workflow if:
# - workflow_dispatch: user requested this job.
# - schedule: always:
# - pull_request: matching skip label is NOT found
if: |
${{
github.event_name == 'schedule' ||
( github.event_name == 'workflow_dispatch' && github.event.inputs.jobs_list == 'gcc-openmp' ) ||
(
github.event_name == 'pull_request' &&
!(
contains(github.event.pull_request.labels.*.name, 'AT: skip gcc-openmp') ||
contains(github.event.pull_request.labels.*.name, 'AT: skip standalone')
)
)
}}
name: gcc-openmp / ${{ matrix.build_type }}
steps:
- name: Show action trigger
uses: actions/github-script@v7
with:
script: |
const eventName = context.eventName;
const eventAction = context.payload.action || 'N/A';
const actor = context.actor;
console.log(`The job was triggered by a ${eventName} event.`);
console.log(` - Event action: ${eventAction}`);
console.log(` - Triggered by: ${actor}`);
- name: Check out the repository
uses: actions/checkout@v4
with:
persist-credentials: false
show-progress: false
submodules: recursive
- name: Set test-all inputs based on event specs
run: |
echo "submit=false" >> $GITHUB_ENV
echo "generate=false" >> $GITHUB_ENV
if [ "${{ github.event_name }}" == "schedule" ]; then
echo "submit=true" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ "${{ inputs.bless }}" == "true" ]; then
echo "generate=true" >> $GITHUB_ENV
fi
fi
- name: Run tests
uses: ./.github/actions/test-all-scream
with:
build_type: ${{ matrix.build_type }}
machine: ghci-snl-cpu
generate: ${{ env.generate }}
submit: ${{ env.submit }}
cmake-configs: Kokkos_ENABLE_OPENMP=ON
# cuda:
# # Disable until the CUDA container is up and running. When CUDA container is availabe, remove
# # this line and uncomment the next if
# if: false
# # Runs always for pull_request. For workflow_dispatch, user must request this machine
# # if: ${{ github.event_name == 'pull_request' || contains(github.event.inputs.jobs_to_run, 'openmp-gcc') }}
# runs-on: [self-hosted, cuda]
# strategy:
# fail-fast: false
# matrix:
# build_type: [sp, dbg, fpe, opt]
# name: cuda-${{ matrix.build_type }}
# steps:
# - name: Show action trigger
# uses: ./.github/actions/print-workflow-trigger
# - name: Check out the repository
# uses: actions/checkout@v4
# with:
# persist-credentials: false
# show-progress: false
# submodules: recursive
# - name: Run tests
# uses: ./.github/actions/test-all-scream
# with:
# build_type: ${{ matrix.build_type }}
# machine: ghci-snl-cuda
# run_type: at-run