Skip to content

Commit 327c3e0

Browse files
authored
Merge branch 'master' into jinboxie/atm/e3smv3_oro_merge
2 parents 84d4934 + de2142e commit 327c3e0

File tree

604 files changed

+22281
-10834
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

604 files changed

+22281
-10834
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Composite action to show the trigger of a workflow
2+
3+
If possible, prints also the user that triggered it
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: 'Show workflow trigger'
2+
description: 'Prints what triggered this workflow'
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Print trigger info
8+
uses: actions/github-script@v7
9+
with:
10+
script: |
11+
const eventName = context.eventName;
12+
const actor = context.actor || 'unknown'; // Default to 'unknown' if actor is not defined
13+
let eventAction = 'N/A';
14+
15+
// Determine the event action based on the event type
16+
if (eventName === 'pull_request') {
17+
eventAction = context.payload.action || 'N/A';
18+
} else if (eventName === 'pull_request_review') {
19+
eventAction = context.payload.review.state || 'N/A';
20+
} else if (eventName === 'workflow_dispatch') {
21+
eventAction = 'manual trigger';
22+
} else if (eventName === 'schedule') {
23+
eventAction = 'scheduled trigger';
24+
}
25+
console.log(`The job was triggered by a ${eventName} event.`);
26+
console.log(` - Event action: ${eventAction}`);
27+
console.log(` - Triggered by: ${actor}`);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Composite action to call test-all-scream inside a workflow
2+
3+
This action is meant to be used inside a workflow. E.g.,
4+
5+
```yaml
6+
jobs:
7+
my-testing:
8+
steps:
9+
...
10+
- name: run-test-all-scream
11+
uses: ./.github/actions/eamxx-test-all-scream
12+
with:
13+
build_type: <build-type>
14+
machine: <machine>
15+
run_type: <run-type>
16+
```
17+
18+
The input run_type is the only input that this action has to explicitly handle.
19+
As such, this action checks that its value is one of the following.
20+
21+
- nightly: runs tests and then submit to cdash
22+
- at-run: runs tests without submitting to cdash
23+
- bless: runs tests and copy output files to baselines folder
24+
25+
As for build_type and machine, we do not prescribe a list of
26+
valid values, as that will be handled by components/eamxx/scripts/test-all-scream.
27+
If their values are not supported, it is up to test-all-scram to handle the error.
28+
As a guideline, however, you may have to ensure that the following exist:
29+
30+
- the file components/eamxx/cmake/machine-files/${machine}.cmake
31+
- the entry ${machine} in the MACHINE_METADATA dict in components/eamxx/scripts/machine_specs.py
32+
33+
Questions? Contact Luca Bertagna [[email protected]](mailto:[email protected])
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: EAMxx standalone testing
2+
description: |
3+
Run EAMxx standalone testing with required configuration inputs.
4+
More precisely, it launches test-all-scream with the proper flags.
5+
See components/eamxx/scripts/test-all-scream for more details.
6+
The configuration inputs are:
7+
- build_type: the type of build to pass to test-all-scream.
8+
- machine: the name of the machine to pass to test-all-scream
9+
- generate: whether to generate baselines
10+
- submit: whether to submit to cdash (unused if generate is 'true')
11+
12+
inputs:
13+
build_type:
14+
description: 'Build type to run'
15+
required: true
16+
machine:
17+
description: 'Machine name for test-all-scream'
18+
required: true
19+
generate:
20+
description: 'Generate baselines instead of running tests'
21+
required: true
22+
default: 'false'
23+
valid_values:
24+
- 'true'
25+
- 'false'
26+
submit:
27+
description: 'Submit results to cdash (unused if generate=true)'
28+
required: true
29+
default: 'false'
30+
valid_values:
31+
- 'true'
32+
- 'false'
33+
cmake-configs:
34+
description: 'Semicolon-separated list of key=value pairs for CMake to pass to test-all-scream'
35+
required: false
36+
default: ''
37+
38+
runs:
39+
using: "composite"
40+
steps:
41+
- name: Set CA certificates env var
42+
run: |
43+
# Ensure the operating system is Linux
44+
if [ "$(uname)" != "Linux" ]; then
45+
echo "This action only supports Linux."
46+
exit 1
47+
fi
48+
# Set env var to be used in upload-artifacts phase
49+
if [ -f /etc/debian_version ]; then
50+
echo "NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt" >> $GITHUB_ENV
51+
elif [ -f /etc/redhat-release ] || [ -f /etc/centos-release ] || [ -f /etc/fedora-release ]; then
52+
echo "NODE_EXTRA_CA_CERTS=/etc/pki/tls/certs/ca-bundle.crt" >> $GITHUB_ENV
53+
else
54+
echo "Unsupported Linux distribution"
55+
exit 1
56+
fi
57+
shell: sh
58+
- name: Check repo presence
59+
run: |
60+
if [ ! -d ".git" ]; then
61+
echo "Repository is not checked out. Please ensure the repository is checked out before running this action."
62+
exit 1
63+
fi
64+
shell: sh
65+
- name: Print build specs
66+
run: |
67+
echo "Testing EAMxx standalone, for the following configuration:"
68+
echo " build type : ${{ inputs.build_type }}"
69+
echo " machine : ${{ inputs.machine }}"
70+
echo " generate : ${{ inputs.generate }}"
71+
echo " submit : ${{ inputs.submit }}"
72+
echo " cmake-configs: ${{ inputs.cmake-configs }}"
73+
shell: sh
74+
- name: Run test-all-scream
75+
working-directory: components/eamxx
76+
run: |
77+
cmd="./scripts/test-all-scream -m ${{ inputs.machine }} -t ${{inputs.build_type}} --baseline-dir AUTO -c EKAT_DISABLE_TPL_WARNINGS=ON"
78+
if [ "${{ inputs.generate }}" = "true" ]; then
79+
cmd+=" -g"
80+
elif [ "${{ inputs.submit }}" = "true" ]; then
81+
cmd+=" -s"
82+
fi
83+
84+
# If cmake-configs is non-empty, add tokens to test-all-scream via "-c key=val"
85+
IFS=';' read -ra configs <<< "${{ inputs.cmake-configs }}"
86+
for config in "${configs[@]}"; do
87+
cmd+=" -c $config"
88+
done
89+
90+
# Print the full command, then run it
91+
echo "test-all-scream call: $cmd"
92+
$cmd
93+
shell: sh
94+
- name: Upload ctest logs
95+
if: always()
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: log-files-${{ inputs.build_type }}-${{ inputs.machine }}
99+
path: |
100+
components/eamxx/ctest-build/*/Testing/Temporary/Last*.log
101+
components/eamxx/ctest-build/*/ctest_resource_file.json
102+
components/eamxx/ctest-build/*/CMakeCache.txt
103+
env:
104+
NODE_EXTRA_CA_CERTS: ${{ env.NODE_EXTRA_CA_CERTS }}

.github/workflows/e3sm-gh-ci-cime-tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ on:
2222

2323
workflow_dispatch:
2424

25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
27+
cancel-in-progress: true
28+
2529
jobs:
2630

2731
ci:
28-
if: ${{ github.event.repository.name == 'e3sm' }}
32+
if: ${{ github.repository == 'E3SM-Project/E3SM' }}
2933
runs-on: ubuntu-latest
3034
strategy:
3135
fail-fast: false
@@ -36,7 +40,7 @@ jobs:
3640
- SMS_D_Ln5_P4.ne4pg2_oQU480.F2010-SCREAMv1-MPASSI.ghci-oci_gnu
3741
- ERS_Ld5_P4.ne4pg2_oQU480.F2010-SCREAMv1-MPASSI.ghci-oci_gnu.eamxx-prod
3842
container:
39-
image: ghcr.io/e3sm-project/containers-ghci:ghci-0.1.0
43+
image: ghcr.io/e3sm-project/containers-ghci:ghci-0.2.0
4044

4145
steps:
4246
-

.github/workflows/e3sm-gh-ci-w-cime-tests.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: gh
1+
name: gh-w
22

33
on:
44
pull_request:
@@ -11,10 +11,14 @@ on:
1111

1212
workflow_dispatch:
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519

16-
ci-w:
17-
if: ${{ github.event.repository.name == 'e3sm' }}
20+
ci:
21+
if: ${{ github.repository == 'E3SM-Project/E3SM' }}
1822
runs-on: ubuntu-latest
1923
strategy:
2024
fail-fast: false
@@ -23,7 +27,7 @@ jobs:
2327
- SMS_D_Ld1_P8.ne4pg2_oQU480.WCYCL2010NS.ghci-oci_gnu
2428
- ERS_Ld3_P8.ne4pg2_oQU480.WCYCL2010NS.ghci-oci_gnu.allactive-wcprod_1850
2529
container:
26-
image: ghcr.io/e3sm-project/containers-ghci:ghci-0.1.0
30+
image: ghcr.io/e3sm-project/containers-ghci:ghci-0.2.0
2731

2832
steps:
2933
-

.github/workflows/e3sm-gh-md-linter.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ on:
1010
# for now let's not lint files in eamxx
1111
- '!components/eamxx/**/*.md'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
linter:
19+
if: ${{ github.repository == 'E3SM-Project/E3SM' }}
1520
runs-on: ubuntu-latest
1621
steps:
1722
- uses: actions/checkout@v4

.github/workflows/e3sm-gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515

1616
jobs:
1717
Build-and-Deploy-docs:
18-
if: ${{ github.event.repository.name == 'e3sm' }}
18+
if: ${{ github.repository == 'E3SM-Project/E3SM' }}
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4

.github/workflows/e3sm-gh-tools-mkatmsrffile-test.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ on:
1111
- cron: '00 15 * * 2'
1212
workflow_dispatch:
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
16+
cancel-in-progress: true
17+
1418
jobs:
1519
mkatmsrffile-test:
20+
if: ${{ github.repository == 'E3SM-Project/E3SM' }}
1621
runs-on: ubuntu-latest
1722
defaults:
1823
run:
@@ -31,18 +36,15 @@ jobs:
3136
uses: conda-incubator/setup-miniconda@v3
3237
with:
3338
activate-environment: "envmkatmsrffile"
34-
miniforge-variant: Mambaforge
3539
miniforge-version: latest
36-
use-mamba: true
37-
mamba-version: "*"
3840
channel-priority: strict
3941
auto-update-conda: true
4042
python-version: 3.11
4143
-
4244
name: Install dependencies
4345
run: |
4446
echo $CONDA_PREFIX
45-
mamba install -y nco xarray numba numpy netcdf4
47+
conda install -y nco xarray numba numpy netcdf4 -c conda-forge
4648
-
4749
name: Run tests
4850
working-directory: components/eam/tools/mkatmsrffile
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: gh-standalone
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
paths:
7+
# first, yes to these
8+
- '.github/workflows/eamxx-gh-ci-standalone.yml'
9+
- 'cime_config/machine/config_machines.xml'
10+
- 'components/eamxx/**'
11+
- 'components/homme/**'
12+
# second, no to these
13+
- '!components/eamxx/docs/**'
14+
- '!components/eamxx/mkdocs.yml'
15+
16+
workflow_dispatch:
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
24+
ci:
25+
if: ${{ github.repository == 'E3SM-Project/E3SM' }}
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
test:
31+
- sp
32+
- opt
33+
- dbg
34+
- fpe
35+
container:
36+
image: ghcr.io/e3sm-project/containers-standalone-ghci:standalone-ghci-0.1.0
37+
38+
steps:
39+
-
40+
name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
show-progress: false
44+
submodules: recursive
45+
-
46+
name: standalone
47+
env:
48+
SHELL: sh
49+
run: |
50+
# TODO: get rid of this extra line if we can?
51+
git config --global safe.directory '*'
52+
./components/eamxx/scripts/test-all-scream -m ghci-oci -t ${{ matrix.test }} -c BUILD_SHARED_LIBS=ON
53+
-
54+
name: Artifacts
55+
uses: actions/upload-artifact@v4
56+
if: ${{ always() }}
57+
with:
58+
name: ${{ matrix.test }}
59+
path: |
60+
components/eamxx/ctest-build/*/Testing/Temporary/Last*.log

0 commit comments

Comments
 (0)