From 3d9c5dfd74778441e7e3a7dfe7a2ed62d3233da8 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 | 72 ++----------------- .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 + .../{macos.yml => macos-regression.yml} | 16 +++-- .github/workflows/other.yml | 2 + .github/workflows/perfmon.yml | 2 + .github/workflows/regression.yml | 2 + .github/workflows/stencil.yml | 2 + 11 files changed, 47 insertions(+), 83 deletions(-) create mode 100644 .github/actions/ubuntu-setup/action.yml rename .github/workflows/{macos.yml => macos-regression.yml} (51%) diff --git a/.github/actions/macos-setup/action.yml b/.github/actions/macos-setup/action.yml index 2e60ce7517..b5d6a69a71 100644 --- a/.github/actions/macos-setup/action.yml +++ b/.github/actions/macos-setup/action.yml @@ -1,33 +1,11 @@ -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 + - name: Install macOS packages shell: bash run: | echo "::group::Install packages" @@ -37,43 +15,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.yml b/.github/workflows/macos-regression.yml similarity index 51% rename from .github/workflows/macos.yml rename to .github/workflows/macos-regression.yml index 192fa719f7..9e1fb67bd3 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos-regression.yml @@ -1,9 +1,9 @@ -name: MacOS Stencil related verification +name: MacOS regression -on: [push, pull_request] +on: [pull_request] jobs: - test-macos-symmetric-layout-rotation: + test-macos-regression: runs-on: macOS-latest @@ -23,11 +23,13 @@ jobs: - uses: ./.github/actions/macos-setup - - name: Compile MOM6 in asymmetric memory mode - run: make build/asymmetric/MOM6 -j + - 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: Run tests - run: make test.grid test.layout test.rotate -k -s + - name: Regression test + run: make test.regression DO_REGRESSION_TESTS=true -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