-
Notifications
You must be signed in to change notification settings - Fork 281
152 lines (136 loc) · 5.84 KB
/
Copy pathBuild.yml
File metadata and controls
152 lines (136 loc) · 5.84 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# This is a CI workflow for the ufs-weather-model repository that builds the
# modified UWM for any given PR.
#
# Alex Richert, Jun 2026
name: Build with CMake
on: [push,pull_request,workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
Build:
strategy:
matrix:
os: ["ubuntu-24.04"]
app: ["ATM", "S2SW", "HAFS-MOM6W"]
compiler:
- name: "gcc"
container: "ghcr.io/noaa-emc/ci-common-build-cache/ufs-weather-model-ubuntu-24.04-gcc-13-mpich-x@sha256:cc9bdafb43d31498fe833c1914d90e32570f8fa9f001e11ca16c4a88417128f8"
- name: "oneapi"
container: "ghcr.io/noaa-emc/ci-common-build-cache/ufs-weather-model-ubuntu-24.04-oneapi-2025.3-intel-oneapi-mpi-2021.17@sha256:a8d5845388f64ed95ad19583b03536b68c48c2c2d8166f66269fac92fd2a0751"
include:
- app: ATM # cover RRFS
ccpp_suites: "FV3_RAP,FV3_RAP_sfcdiff,FV3_HRRR,FV3_RRFS_v1beta,FV3_RRFS_v1nssl"
cmake_args: ""
- app: S2SW # cover GFS (and SFS, RTOFS too)
ccpp_suites: "FV3_GFS_v17_coupled_p8_ugwpv1"
cmake_args: "-DUFS_TRACING=ON" # TODO: -DPDLIB=ON
- app: HAFS-MOM6W # cover HAFS
ccpp_suites: "FV3_HAFS_v1_gfdlmp_tedmf,FV3_HAFS_v1_gfdlmp_tedmf_nonsst,FV3_HAFS_v1_thompson,FV3_HAFS_v1_thompson_nonsst"
cmake_args: ""
runs-on: ${{ matrix.os }}
# Dependencies are preinstalled in a container image.
# For available images, see https://github.com/orgs/NOAA-EMC/packages?tab=packages&q=ufs-weather-model.
# See https://github.com/NOAA-EMC/ci-common-build-cache/#using-container-images for further container usage instructions.
container: ${{ matrix.compiler.container }}
steps:
- name: "Checkout"
uses: actions/checkout@v7.0.1
with:
submodules: recursive
path: ufs-weather-model
- name: "Install Intel compilers & MPI"
if: matrix.compiler.name == 'oneapi'
uses: NOAA-EMC/ci-install-intel-toolkit@develop
with:
install-classic: false
oneapi-version: 2025.3
install-mpi: true
mpi-version: 2021.17
mpi-wrapper-setup: oneapi
- name: "Build UFS Weather Model"
shell: bash
run: |
set -x
set -o pipefail # so cmake failure isn't masked by tee
. /entrypoint.sh
############################
## Modify Spack installation, if needed
##
## For `swap-package` custom Spack command documentation,
## see https://github.com/NOAA-EMC/spack-helpers#modify-package-spec-swap-package.
## To request a package addition or update , create an issue or PR at
## https://github.com/NOAA-EMC/ci-common-build-cache/.
##
## Configure a different version/build options for a package:
#spack swap-package --concretize scotch@7.0.9
## Configure an additional package not already in Spack:
#spack add py-scipy
#spack concretize --fresh
## Run the installation:
#spack install --only-concrete
############################
# Prevent possible warnings by removing 'runtime' packages:
spack uninstall --force --yes-to-all gcc-runtime
if [ ${{ matrix.compiler.name }} == oneapi ]; then
spack uninstall --force --yes-to-all intel-oneapi-runtime
fi
###
if [ ${{ matrix.compiler.name }} == gcc ]; then
export CC=mpicc ; export CXX=mpic++ ; export FC=mpif90
fi
esmfcmakemoddir=$(spack location --install-dir esmf)/cmake
cmake -S $GITHUB_WORKSPACE/ufs-weather-model -B build \
-DAPP=${{ matrix.app }} \
-DCCPP_SUITES=${{ matrix.ccpp_suites }} \
-D32BIT=ON \
-DUSE_ESMF_STATIC_LIBS=OFF \
-DCMAKE_MODULE_PATH=$esmfcmakemoddir \
-DDEBUG=ON \
${{ matrix.cmake_args }}
# Save compile logs to check warnings
mkdir -p build-logs
cmake --build build --parallel 4 2>&1 | tee build-logs/build-out-${{ matrix.app }}-${{ matrix.compiler.name }}.txt
- name: "Upload Build Logs"
if: always() # Run this even if the build fails
uses: actions/upload-artifact@v7.0.1
with:
name: build-logs-${{ matrix.app }}-${{ matrix.compiler.name }}
path: build-logs/build-out-*.txt
# -------------------------------------------------------------------------
# Parse build logs and annotate GitHub PR with new compiler warnings
# -------------------------------------------------------------------------
check-warnings:
name: Check New and Legacy Compiler Warnings
runs-on: ubuntu-24.04
needs: [Build]
if: (success() || failure()) # Ensures this runs even if CMake compilation fails
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
- name: Download Build Logs
uses: actions/download-artifact@v8.0.1
with:
pattern: build-logs-*
path: ./build-logs
merge-multiple: true # Consolidates all matrix logs into the single folder
- name: Run Compiler Warnings Check
env:
GITHUB_BASE_REF: ${{ github.base_ref }}
run: |
echo "Fetching target branch for diff comparison..."
git fetch origin ${{ github.base_ref }}
echo "--- Build log files downloaded for check-warnings ---"
find ./build-logs -type f
echo "Running custom Python warning parser..."
python ${{ github.workspace }}/.github/scripts/check_build_compile_warnings.py ./build-logs
- name: Upload Warnings Report
if: always()
uses: actions/upload-artifact@v7.0.1
with:
name: report-compiler-warnings
path: all_compiler_warnings.txt