From 5078542327623ecfc7a1524a039b09c43c43675f Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Thu, 4 Jan 2024 13:28:18 -0500 Subject: [PATCH] MacOS GitHub Actions Testing testing... --- .github/actions/macos-setup/action.yml | 33 +++++++++++++++++++ .github/workflows/macos-compile.yml | 20 +++++++++++ .../{compile.yml => ubuntu-compile.yml} | 0 3 files changed, 53 insertions(+) create mode 100644 .github/actions/macos-setup/action.yml create mode 100644 .github/workflows/macos-compile.yml rename .github/workflows/{compile.yml => ubuntu-compile.yml} (100%) diff --git a/.github/actions/macos-setup/action.yml b/.github/actions/macos-setup/action.yml new file mode 100644 index 000000000..4c248abd1 --- /dev/null +++ b/.github/actions/macos-setup/action.yml @@ -0,0 +1,33 @@ +name: 'install-macos-prerequisites' + +description: 'Install prerequisites for Mac OS compilation' + +runs: + using: 'composite' + + steps: + - name: Install macOS packages + shell: bash + run: | + echo "::group::Install packages" + brew reinstall gcc + brew install automake + brew install netcdf + brew install netcdf-fortran + brew install mpich + echo "::endgroup::" + + # NOTE: Floating point exceptions are currently disabled due to an error in + # HDF5 1.4.3. They will be re-enabled when the default brew version has + # been updated to a working version. + + - name: Set compiler flags + shell: bash + run: | + cd .testing + echo "FCFLAGS_DEBUG = -g -O0 -Wextra -Wno-compare-reals -fbacktrace -fcheck=bounds" >> config.mk + echo "FCFLAGS_REPRO = -g -O2 -fbacktrace" >> config.mk + echo "FCFLAGS_INIT = -finit-real=snan -finit-integer=2147483647 -finit-derived" >> config.mk + echo "FCFLAGS_FMS = -g -fbacktrace -O0" >> config.mk + cat config.mk + echo "::endgroup::" diff --git a/.github/workflows/macos-compile.yml b/.github/workflows/macos-compile.yml new file mode 100644 index 000000000..b347079b9 --- /dev/null +++ b/.github/workflows/macos-compile.yml @@ -0,0 +1,20 @@ +name: MacOS Compilation Test + +on: [push, pull_request] + +jobs: + compile: + + runs-on: macOS-latest + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - uses: ./.github/actions/macos-setup + + - name: Compile models + run: make -j + + # TODO: Run a few of the models and compare parameter.doc files? diff --git a/.github/workflows/compile.yml b/.github/workflows/ubuntu-compile.yml similarity index 100% rename from .github/workflows/compile.yml rename to .github/workflows/ubuntu-compile.yml