Skip to content

Commit 0b18d94

Browse files
committed
Update CI
1 parent af303f4 commit 0b18d94

File tree

3 files changed

+214
-3
lines changed

3 files changed

+214
-3
lines changed

.github/workflows/enforce-labels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ jobs:
88
require-label:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: mheap/github-action-required-labels@v3
11+
- uses: mheap/github-action-required-labels@v5
1212
env:
1313
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1414
with:
1515
mode: minimum
1616
count: 1
17-
labels: "0 diff,0 diff trivial,Non 0-diff,0 diff structural,0-diff trivial,Not 0-diff,0-diff,automatic,0-diff uncoupled"
17+
labels: "0 diff,0 diff trivial,Non 0-diff,0 diff structural,0-diff trivial,Not 0-diff,0-diff,automatic,0-diff uncoupled,github_actions"
1818
add_comment: true
1919
message: "This PR is being prevented from merging because you have not added one of our required labels: {{ provided }}. Please add one so that the PR can be merged."
2020

2121
blocking-label:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: mheap/github-action-required-labels@v3
24+
- uses: mheap/github-action-required-labels@v5
2525
env:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2727
with:

.github/workflows/spack-ci.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Spack CI GCC Build
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
# Do not run if the only files changed cannot affect the build
7+
paths-ignore:
8+
- "**.md"
9+
- "**.pro"
10+
- "**.sh"
11+
- "**.perl"
12+
- ".github/CODEOWNERS"
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
18+
19+
jobs:
20+
build_gcm:
21+
name: Spack CI GCC Build
22+
runs-on: ubuntu-24.04
23+
steps:
24+
25+
- name: Checkout GCM
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 1
29+
filter: blob:none
30+
repository: GEOS-ESM/GEOSgcm
31+
ref: feature/sdrabenh/gcm_v12
32+
33+
- name: Set all directories as git safe
34+
run: |
35+
git config --global --add safe.directory '*'
36+
37+
- name: Setup Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: '3.13'
41+
42+
- name: Pip install mepo
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install mepo
46+
mepo --version
47+
48+
- name: Mepo clone external repos
49+
run: |
50+
ls
51+
mepo clone --partial blobless
52+
mepo status
53+
54+
- name: Mepo develop usual suspects
55+
run: |
56+
ls
57+
mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared GEOS_Util
58+
mepo status
59+
60+
- name: Debug PR branch
61+
run: echo "PR is coming from ${{ github.event.pull_request.head.ref }}"
62+
63+
- name: Update other branches
64+
if: ${{ github.event.pull_request.head.ref != 'main' && github.event.pull_request.head.ref != 'develop' }}
65+
run: |
66+
mepo checkout-if-exists ${GITHUB_HEAD_REF}
67+
mepo status
68+
69+
- name: Set up Spack
70+
uses: spack/setup-spack@v2
71+
with:
72+
ref: develop # Spack version (examples: develop, releases/v0.21)
73+
color: true # Force color output (SPACK_COLOR=always)
74+
path: spack # Where to clone Spack
75+
buildcache: false # Do not use the spack buildcache
76+
77+
- name: Find compilers
78+
shell: spack-bash {0}
79+
run: |
80+
spack compiler find
81+
82+
- name: Set default compiler and target
83+
shell: spack-bash {0}
84+
run: |
85+
spack config add 'packages:all:require:target=x86_64_v3'
86+
87+
- name: Create Spack environment
88+
shell: spack-bash {0}
89+
run: |
90+
spack env create spack-env
91+
spack env activate spack-env
92+
93+
- name: Login
94+
shell: spack-bash {0}
95+
run: |
96+
spack -e spack-env mirror add geos-buildcache oci://ghcr.io/GEOS-ESM/geos-buildcache
97+
spack -e spack-env mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.BUILDCACHE_TOKEN }}" geos-buildcache
98+
spack -e spack-env mirror list
99+
spack -e spack-env buildcache update-index geos-buildcache
100+
spack -e spack-env buildcache list --allarch
101+
102+
- name: Concretize
103+
shell: spack-bash {0}
104+
run: |
105+
spack -e spack-env concretize
106+
107+
- name: Install
108+
shell: spack-bash {0}
109+
run: |
110+
spack clean -m
111+
spack -e spack-env install --add --no-check-signature --use-buildcache only \
112+
esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits openblas
113+
114+
- name: Build with Cmake
115+
shell: spack-bash {0}
116+
run: |
117+
spack env activate spack-env
118+
spack load \
119+
esmf gftl gftl-shared fargparse pflogger pfunit yafyaml ecbuild udunits openblas
120+
spack find --loaded
121+
FC=gfortran-14 CC=gcc-14 CXX=g++-14
122+
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DCMAKE_Fortran_COMPILER=${FC} -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX}
123+
cmake --build build -j 4
124+
cmake --install build
125+

.github/workflows/workflow.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Build Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
# Do not run if the only files changed cannot affect the build
7+
paths-ignore:
8+
- "**.md"
9+
- "**.pro"
10+
- "**.sh"
11+
- "**.perl"
12+
- ".github/CODEOWNERS"
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
17+
18+
jobs:
19+
build_gcm:
20+
name: Build GEOSgcm
21+
if: "!contains(github.event.pull_request.labels.*.name, '0 diff trivial')"
22+
runs-on: ubuntu-24.04
23+
container:
24+
image: gmao/ubuntu24-geos-env:v8.14.0-intelmpi_2021.13-ifort_2021.13
25+
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
26+
# It seems like we might not need secrets on GitHub Actions which is good for forked
27+
# pull requests
28+
#credentials:
29+
#username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
#password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
env:
33+
OMPI_ALLOW_RUN_AS_ROOT: 1
34+
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
35+
OMPI_MCA_btl_vader_single_copy_mechanism: none
36+
37+
steps:
38+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
39+
- name: Delete huge unnecessary tools folder
40+
run: rm -rf /opt/hostedtoolcache
41+
42+
- name: Checkout GCM
43+
uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 1
46+
filter: blob:none
47+
repository: GEOS-ESM/GEOSgcm
48+
ref: feature/sdrabenh/gcm_v12
49+
50+
- name: Set all directories as git safe
51+
run: |
52+
git config --global --add safe.directory '*'
53+
54+
- name: Versions etc.
55+
run: |
56+
ifort --version
57+
mpirun --version
58+
echo $BASEDIR
59+
60+
- name: Mepo clone external repos
61+
run: |
62+
mepo clone --partial blobless
63+
mepo status
64+
65+
- name: Mepo develop usual suspects
66+
run: |
67+
mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared GEOS_Util
68+
mepo status
69+
70+
- name: Debug PR branch
71+
run: echo "PR is coming from ${{ github.event.pull_request.head.ref }}"
72+
73+
- name: Update other branches
74+
if: ${{ github.event.pull_request.head.ref != 'main' && github.event.pull_request.head.ref != 'develop' }}
75+
run: |
76+
mepo checkout-if-exists ${GITHUB_HEAD_REF}
77+
mepo status
78+
79+
- name: CMake
80+
run: |
81+
cmake -B build -S . --install-prefix=${pwd}/install -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_BUILD_TYPE=Debug -DMPIEXEC_PREFLAGS='--oversubscribe' -DUSE_F2PY=OFF
82+
83+
- name: Build
84+
run: |
85+
cmake --build build -j 4
86+
cmake --install build

0 commit comments

Comments
 (0)