Jenkins RT Refactor Updates #282
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |