From c9e9e60615bb98bd501c4a8a481604bc84e05d56 Mon Sep 17 00:00:00 2001 From: Marshall Ward Date: Tue, 14 Jun 2022 11:27:41 -0400 Subject: [PATCH] Restructued the GitHub Actions CI Testing out a new structure, moving the OS-specific stuff into a separate file. (Currently just package installs) --- .github/actions/macos-setup/action.yml | 73 ++---------------------- .github/actions/testing-setup/action.yml | 9 --- .github/actions/ubuntu-setup/action.yml | 19 ++++++ .github/workflows/coupled-api.yml | 2 + .github/workflows/coverage.yml | 2 + .github/workflows/expression.yml | 2 + .github/workflows/macos-regression.yml | 34 +++++++++++ .github/workflows/macos.yml | 33 ----------- .github/workflows/other.yml | 2 + .github/workflows/perfmon.yml | 2 + .github/workflows/regression.yml | 2 + .github/workflows/stencil.yml | 2 + 12 files changed, 73 insertions(+), 109 deletions(-) create mode 100644 .github/actions/ubuntu-setup/action.yml create mode 100644 .github/workflows/macos-regression.yml delete mode 100644 .github/workflows/macos.yml diff --git a/.github/actions/macos-setup/action.yml b/.github/actions/macos-setup/action.yml index 2e60ce7517..dcb783c8ee 100644 --- a/.github/actions/macos-setup/action.yml +++ b/.github/actions/macos-setup/action.yml @@ -1,33 +1,12 @@ -name: 'Build-.testing-prerequisites' -description: 'Build pre-requisites for .testing including FMS and a symmetric MOM6 executable' -inputs: - build_symmetric: - description: 'If true, will build the symmetric MOM6 executable' - required: false - default: 'true' - install_python: - description: 'If true, will install the local python env needed for .testing' - required: false - default: 'true' +name: 'install-macos-prerequisites' + +description: 'Install prerequisites for Mac OS compilation' + runs: using: 'composite' - steps: - - name: Git info - shell: bash - run: | - echo "::group::Git commit info" - echo "git log:" - git log | head -60 - echo "::endgroup::" - - name: Env - shell: bash - run: | - echo "::group::Environment" - env - echo "::endgroup::" - - - name: Install needed packages for compiling + steps: + - name: Install macOS packages shell: bash run: | echo "::group::Install packages" @@ -37,43 +16,3 @@ runs: brew install netcdf brew install mpich echo "::endgroup::" - - - name: Compile FMS library - shell: bash - run: | - echo "::group::Compile FMS library" - cd .testing - make deps/lib/libFMS.a -s -j - echo "::endgroup::" - - - name: Store compiler flags used in Makefile - shell: bash - run: | - echo "::group::config.mk" - cd .testing - echo "FCFLAGS_DEBUG=-g -O0 -Wextra -Wno-compare-reals -fbacktrace -ffpe-trap=invalid,zero,overflow -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 - cat config.mk - echo "::endgroup::" - - - name: Compile MOM6 in symmetric memory mode - shell: bash - run: | - echo "::group::Compile MOM6 in symmetric memory mode" - cd .testing - test ${{ inputs.build_symmetric }} == true && make build/symmetric/MOM6 -j - echo "::endgroup::" - - - name: Install local python venv for generating input data - shell: bash - run: | - echo "::group::Create local python env for input data generation" - cd .testing - test ${{ inputs.install_python }} == true && make work/local-env - echo "::endgroup::" - - - name: Set flags - shell: bash - run: | - echo "TIMEFORMAT=... completed in %lR (user: %lU, sys: %lS)" >> $GITHUB_ENV diff --git a/.github/actions/testing-setup/action.yml b/.github/actions/testing-setup/action.yml index e95145c1a1..a21ee949db 100644 --- a/.github/actions/testing-setup/action.yml +++ b/.github/actions/testing-setup/action.yml @@ -27,15 +27,6 @@ runs: env echo "::endgroup::" - - name: Install needed packages for compiling - shell: bash - run: | - echo "::group::Install linux packages" - sudo apt-get update - sudo apt-get install netcdf-bin libnetcdf-dev libnetcdff-dev mpich libmpich-dev - sudo apt-get install linux-tools-common - echo "::endgroup::" - - name: Compile FMS library shell: bash run: | diff --git a/.github/actions/ubuntu-setup/action.yml b/.github/actions/ubuntu-setup/action.yml new file mode 100644 index 0000000000..3fd2ea13cf --- /dev/null +++ b/.github/actions/ubuntu-setup/action.yml @@ -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 mpich + sudo apt-get install libmpich-dev + sudo apt-get install linux-tools-common + echo "::endgroup::" diff --git a/.github/workflows/coupled-api.yml b/.github/workflows/coupled-api.yml index 86d7262548..443755c7f4 100644 --- a/.github/workflows/coupled-api.yml +++ b/.github/workflows/coupled-api.yml @@ -15,6 +15,8 @@ jobs: with: submodules: recursive + - uses: ./.github/actions/ubuntu-setup + - uses: ./.github/actions/testing-setup with: build_symmetric: 'false' diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 84fc4c75ff..1fc95e9127 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,6 +18,8 @@ jobs: with: submodules: recursive + - uses: ./.github/actions/ubuntu-setup + - uses: ./.github/actions/testing-setup - name: Compile unit testing diff --git a/.github/workflows/expression.yml b/.github/workflows/expression.yml index 020d656aee..adedf630b9 100644 --- a/.github/workflows/expression.yml +++ b/.github/workflows/expression.yml @@ -15,6 +15,8 @@ jobs: with: submodules: recursive + - uses: ./.github/actions/ubuntu-setup + - uses: ./.github/actions/testing-setup - name: Compile MOM6 using repro optimization diff --git a/.github/workflows/macos-regression.yml b/.github/workflows/macos-regression.yml new file mode 100644 index 0000000000..d975854e0c --- /dev/null +++ b/.github/workflows/macos-regression.yml @@ -0,0 +1,34 @@ +name: MacOS regression + +on: [pull_request] + +jobs: + test-macos-regression: + + runs-on: macOS-latest + + env: + CC: gcc-11 + FC: gfortran-11 + + defaults: + run: + working-directory: .testing + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: ./.github/actions/macos-setup + + - uses: ./.github/actions/testing-setup + + - name: Compile reference model + run: make build.regressions MOM_TARGET_SLUG=$GITHUB_REPOSITORY MOM_TARGET_LOCAL_BRANCH=$GITHUB_BASE_REF DO_REGRESSION_TESTS=true -j + + - name: Create validation data + run: make run.symmetric -k -s + + - name: Regression test + run: make test.regression DO_REGRESSION_TESTS=true -k -s diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 192fa719f7..0000000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: MacOS Stencil related verification - -on: [push, pull_request] - -jobs: - test-macos-symmetric-layout-rotation: - - runs-on: macOS-latest - - # TODO: Move these to the macos config file? - env: - CC: gcc-11 - FC: gfortran-11 - - defaults: - run: - working-directory: .testing - - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - uses: ./.github/actions/macos-setup - - - name: Compile MOM6 in asymmetric memory mode - run: make build/asymmetric/MOM6 -j - - - name: Create validation data - run: make run.symmetric -k -s - - - name: Run tests - run: make test.grid test.layout test.rotate -k -s diff --git a/.github/workflows/other.yml b/.github/workflows/other.yml index 34239b0b7c..c992c8c6ec 100644 --- a/.github/workflows/other.yml +++ b/.github/workflows/other.yml @@ -15,6 +15,8 @@ jobs: with: submodules: recursive + - uses: ./.github/actions/ubuntu-setup + - uses: ./.github/actions/testing-setup - name: Compile with openMP diff --git a/.github/workflows/perfmon.yml b/.github/workflows/perfmon.yml index 00e645c4fd..896b9d51d8 100644 --- a/.github/workflows/perfmon.yml +++ b/.github/workflows/perfmon.yml @@ -15,6 +15,8 @@ jobs: with: submodules: recursive + - uses: ./.github/actions/ubuntu-setup + - uses: ./.github/actions/testing-setup - name: Compile optimized models diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index acc42e4720..15dcdbceb2 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -15,6 +15,8 @@ jobs: with: submodules: recursive + - uses: ./.github/actions/ubuntu-setup + - uses: ./.github/actions/testing-setup - name: Compile reference model diff --git a/.github/workflows/stencil.yml b/.github/workflows/stencil.yml index 51a0611fc4..6f4a7b1790 100644 --- a/.github/workflows/stencil.yml +++ b/.github/workflows/stencil.yml @@ -15,6 +15,8 @@ jobs: with: submodules: recursive + - uses: ./.github/actions/ubuntu-setup + - uses: ./.github/actions/testing-setup - name: Compile MOM6 in asymmetric memory mode