|
| 1 | +# This is a CI workflow for the ufs-weather-model repository that builds the |
| 2 | +# modified UWM for any given PR. |
| 3 | +# |
| 4 | +# Alex Richert, Jun 2026 |
| 5 | + |
| 6 | +name: Build with CMake |
| 7 | +on: [push,pull_request,workflow_dispatch] |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +jobs: |
| 14 | + Spack: |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + os: ["ubuntu-24.04"] |
| 18 | + app: ["S2SWA", "ATM"] |
| 19 | + compiler: |
| 20 | + - name: "gcc" |
| 21 | + container: "ghcr.io/noaa-emc/ci-common-build-cache/ufs-weather-model-ubuntu-24.04-gcc-13-mpich-x@sha256:cc9bdafb43d31498fe833c1914d90e32570f8fa9f001e11ca16c4a88417128f8" |
| 22 | + - name: "oneapi" |
| 23 | + 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" |
| 24 | + include: |
| 25 | + - app: S2SWA |
| 26 | + ccpp_suites: "FV3_GFS_v17_coupled_p8,FV3_GFS_v17_coupled_p8_ugwpv1" |
| 27 | + - app: ATM |
| 28 | + ccpp_suites: "FV3_GFS_v16,FV3_GFS_v16_flake,FV3_GFS_v16_ras,FV3_GFS_v17_p8,FV3_GFS_v17_p8_ugwpv1" |
| 29 | + |
| 30 | + runs-on: ${{ matrix.os }} |
| 31 | + # Dependencies are preinstalled in a container image. |
| 32 | + # For available images, see https://github.com/orgs/NOAA-EMC/packages?tab=packages&q=ufs-weather-model. |
| 33 | + # See https://github.com/NOAA-EMC/ci-common-build-cache/#using-container-images for further container usage instructions. |
| 34 | + container: ${{ matrix.compiler.container }} |
| 35 | + |
| 36 | + steps: |
| 37 | + |
| 38 | + - name: "Checkout" |
| 39 | + uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + submodules: recursive |
| 42 | + path: ufs-weather-model |
| 43 | + |
| 44 | + - name: "Install Intel compilers & MPI" |
| 45 | + if: matrix.compiler.name == 'oneapi' |
| 46 | + uses: NOAA-EMC/ci-install-intel-toolkit@develop |
| 47 | + with: |
| 48 | + install-classic: false |
| 49 | + oneapi-version: 2025.3 |
| 50 | + install-mpi: true |
| 51 | + mpi-version: 2021.17 |
| 52 | + mpi-wrapper-setup: oneapi |
| 53 | + |
| 54 | + - name: "Build UFS Weather Model" |
| 55 | + shell: bash |
| 56 | + run: | |
| 57 | + set -x |
| 58 | + . /entrypoint.sh |
| 59 | + ############################ |
| 60 | + ## Modify Spack installation, if needed |
| 61 | + ## |
| 62 | + ## For `swap-package` custom Spack command documentation, |
| 63 | + ## see https://github.com/NOAA-EMC/spack-helpers#modify-package-spec-swap-package. |
| 64 | + ## To request a package addition or update , create an issue or PR at |
| 65 | + ## https://github.com/NOAA-EMC/ci-common-build-cache/. |
| 66 | + ## |
| 67 | + ## Configure a different version/build options for a package: |
| 68 | + #spack swap-package --concretize scotch@7.0.9 |
| 69 | + ## Configure an additional package not already in Spack: |
| 70 | + #spack add py-scipy |
| 71 | + #spack concretize --fresh |
| 72 | + ## Run the installation: |
| 73 | + #spack install --only-concrete |
| 74 | + ############################ |
| 75 | + # Prevent possible warnings by removing 'runtime' packages: |
| 76 | + spack uninstall --force --yes-to-all gcc-runtime |
| 77 | + if [ ${{ matrix.compiler.name }} == oneapi ]; then |
| 78 | + spack uninstall --force --yes-to-all intel-oneapi-runtime |
| 79 | + fi |
| 80 | + ### |
| 81 | + if [ ${{ matrix.compiler.name }} == gcc ]; then |
| 82 | + export CC=mpicc ; export CXX=mpic++ ; export FC=mpif90 |
| 83 | + fi |
| 84 | + esmfcmakemoddir=$(spack location --install-dir esmf)/cmake |
| 85 | + cmake -S $GITHUB_WORKSPACE/ufs-weather-model -B build \ |
| 86 | + -DAPP=${{ matrix.app }} \ |
| 87 | + -DCCPP_SUITES=${{ matrix.ccpp_suites }} \ |
| 88 | + -D32BIT=ON \ |
| 89 | + -DUSE_ESMF_STATIC_LIBS=OFF \ |
| 90 | + -DCMAKE_MODULE_PATH=$esmfcmakemoddir |
| 91 | + cmake --build build --parallel 4 |
0 commit comments