Skip to content

Commit

Permalink
Enable GitHub Actions compilation testing
Browse files Browse the repository at this point in the history
This is a minimal GitHub Actions compilation test for MOM6-examples.  It
primarily only ensures that the model builds after a simple `make -j`
command, without additional configuration.

This can be expanded in the future to include other platforms, as well
as actual model runs and parameter output testing.
  • Loading branch information
marshallward authored and adcroft committed Jan 31, 2024
1 parent 5395ce6 commit caad73e
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/actions/macos-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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::"
19 changes: 19 additions & 0 deletions .github/actions/ubuntu-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'install-ubuntu-prerequisites'

description: 'Install prerequisites for Ubuntu Linux compilation'

runs:
using: 'composite'
steps:
- name: Install Ubuntu Linux packages
shell: bash
run: |
echo "::group::Install linux packages"
sudo apt-get update
sudo apt-get install netcdf-bin
sudo apt-get install libnetcdf-dev
sudo apt-get install libnetcdff-dev
sudo apt-get install openmpi-bin
sudo apt-get install libopenmpi-dev
sudo apt-get install linux-tools-common
echo "::endgroup::"
24 changes: 24 additions & 0 deletions .github/workflows/macos-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: MacOS Compilation Test

on: [push, pull_request]

jobs:
compile:

runs-on: macOS-latest

env:
CC: gcc
FC: gfortran

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?
21 changes: 21 additions & 0 deletions .github/workflows/ubuntu-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Compile test

on: [push, pull_request]

jobs:
compile:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: ./.github/actions/ubuntu-setup

# TODO: Split ocean-only and ice-ocean?
- name: Compile models
run: make -j

# TODO: Run a few of the models and compare parameter.doc files?

0 comments on commit caad73e

Please sign in to comment.