@@ -346,3 +346,164 @@ jobs:
346346 with :
347347 files : release-dist/**
348348 generate_release_notes : true
349+
350+ bindc :
351+ name : Build (${{ matrix.os }} / ${{ matrix.toolchain.ccompiler }} / ${{matrix.toolchain.fcompiler}})
352+ runs-on : ${{ matrix.os }}
353+ strategy :
354+ fail-fast : false
355+ matrix :
356+ os : [ubuntu-22.04, macos-latest, windows-latest]
357+ toolchain :
358+ - ccompiler : gcc
359+ cversion : " 11"
360+ fcompiler : gcc
361+ fversion : " 11"
362+ include :
363+ - os : ubuntu-22.04
364+ toolchain :
365+ ccompiler : gcc
366+ cversion : " 13"
367+ fcompiler : gcc
368+ fversion : " 13"
369+ - os : ubuntu-22.04
370+ toolchain :
371+ ccompiler : intel
372+ cversion : " 2023.1"
373+ fcompiler : intel
374+ fversion : " 2023.1"
375+ - os : ubuntu-22.04
376+ toolchain :
377+ ccompiler : intel-classic
378+ cversion : " 2021.9"
379+ fcompiler : intel-classic
380+ fversion : " 2021.9"
381+ - os : windows-latest
382+ toolchain :
383+ ccompiler : msvc
384+ cversion : latest
385+ fcompiler : intel
386+ fversion : " 2025.2"
387+ - os : windows-latest
388+ toolchain :
389+ ccompiler : intel
390+ cversion : " 2025.2"
391+ fcompiler : intel
392+ fversion : " 2025.2"
393+ defaults :
394+ run :
395+ shell : bash
396+ steps :
397+ - name : Check out CEA
398+ uses : actions/checkout@v6
399+
400+ - name : Check out GFE
401+ if : ${{ runner.os != 'Windows' }}
402+ uses : actions/checkout@v6
403+ with :
404+ repository : Goddard-Fortran-Ecosystem/GFE
405+ path : extern/gfe
406+ submodules : true
407+
408+ - name : Set up Fortran compiler
409+ if : ${{ runner.os != 'Windows' || matrix.toolchain.fcompiler != 'gcc' }}
410+ uses : fortran-lang/setup-fortran@v1
411+ with :
412+ compiler : ${{ matrix.toolchain.fcompiler }}
413+ version : ${{ matrix.toolchain.fversion }}
414+
415+ - name : Set up Fortran compiler (Windows, gfortran)
416+ if : ${{ runner.os == 'Windows' && matrix.toolchain.fcompiler == 'gcc' }}
417+ run : |
418+ # Use pre-installed MinGW on Windows runners to avoid Chocolatey issues
419+ # GitHub Actions windows-latest runners include MinGW in C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
420+ $mingwPath = "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin"
421+ if (Test-Path $mingwPath) {
422+ echo "$mingwPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
423+ echo "FC=$mingwPath\gfortran.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
424+ } else {
425+ # Fallback: search for gfortran in common locations
426+ $gfortran = Get-Command gfortran -ErrorAction SilentlyContinue
427+ if ($gfortran) {
428+ echo "FC=$($gfortran.Source)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
429+ } else {
430+ Write-Error "gfortran not found on Windows runner"
431+ exit 1
432+ }
433+ }
434+ shell : pwsh
435+
436+ - name : Set up C Compiler
437+ if : ${{matrix.toolchain.ccompiler == 'msvc'}}
438+ uses : ilammy/msvc-dev-cmd@v1
439+
440+ - name : Install build tools
441+ run : |
442+ python -m pip install --upgrade pip
443+ python -m pip install ninja setuptools numpy cython
444+
445+ - name : Record toolchain info
446+ run : |
447+ git --version
448+ cmake --version
449+ ninja --version
450+ if command -v gfortran &> /dev/null; then gfortran --version; fi
451+ if [ -n "${FC}" ]; then "${FC}" --version; fi
452+
453+ - name : Configure and Build GFE
454+ if : ${{ runner.os != 'Windows' }}
455+ run : |
456+ cmake -S extern/gfe -B build/extern/gfe -GNinja \
457+ -DCMAKE_INSTALL_PREFIX=build/install \
458+ -DCMAKE_BUILD_TYPE=Release \
459+ -DSKIP_MPI=YES \
460+ -DSKIP_OPENMP=YES \
461+ -DSKIP_FHAMCREST=YES \
462+ -DSKIP_ESMF=YES \
463+ -DSKIP_ROBUST=YES
464+ cmake --build build/extern/gfe --target install
465+
466+ - name : Configure (linux)
467+ if : ${{runner.os != 'Windows' || matrix.toolchain.ccompiler != 'msvc'}}
468+ run : |
469+ cmake -S . -B build -G Ninja \
470+ -DCMAKE_PREFIX_PATH=build/install \
471+ -DCMAKE_BUILD_TYPE=Debug \
472+ -DCEA_BUILD_TESTING=ON \
473+ -DCEA_ENABLE_BIND_C=ON \
474+ -DCEA_ENABLE_BIND_CXX=OFF \
475+ -DCEA_ENABLE_BIND_PYTHON=OFF \
476+ -DCEA_ENABLE_BIND_MATLAB=OFF \
477+ -DCEA_ENABLE_BIND_EXCEL=OFF \
478+ -DCMAKE_Fortran_FLAGS="-ffree-line-length-none"
479+
480+ - name : Configure (msvc)
481+ if : ${{runner.os == 'Windows' && matrix.toolchain.ccompiler == 'msvc'}}
482+ run : |
483+ cmake -S . -B build -G Ninja \
484+ -DCMAKE_BUILD_TYPE=Release \
485+ -DCEA_BUILD_TESTING=ON \
486+ -DCEA_ENABLE_BIND_C=ON \
487+ -DCEA_ENABLE_BIND_CXX=OFF \
488+ -DCEA_ENABLE_BIND_PYTHON=OFF \
489+ -DCEA_ENABLE_BIND_MATLAB=OFF \
490+ -DCEA_ENABLE_BIND_EXCEL=OFF \
491+ -DCMAKE_C_COMPILER=cl \
492+ -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
493+
494+ - name : Build
495+ run : |
496+ cmake --build build
497+
498+ - name : Run smoke test (Unix)
499+ if : runner.os != 'Windows'
500+ run : |
501+ ./build/source/cea -h
502+
503+ - name : Run smoke test (Windows)
504+ if : runner.os == 'Windows'
505+ run : |
506+ ./build/source/cea.exe -h
507+
508+ - name : Run ctest
509+ run : ctest --test-dir build --output-on-failure
0 commit comments