diff --git a/.github/workflows/general-ci-tests.yml b/.github/workflows/general-ci-tests.yml index 67f1d04..556856f 100644 --- a/.github/workflows/general-ci-tests.yml +++ b/.github/workflows/general-ci-tests.yml @@ -11,7 +11,7 @@ on: jobs: # This workflow contains 4 jobs # Build checks out MOM through the CESM and lets us run the standalone version - build_standalone_mom: + check_standalone_mom_lightweight_examples: # The type of runner that the job will run on runs-on: ubuntu-latest @@ -40,10 +40,22 @@ jobs: git clone https://github.com/ESCOMP/CESM.git -b cesm3_0_alpha03a cesm3_0_alpha03a cd cesm3_0_alpha03a ./bin/git-fleximod update - - name: Checkout MOM Branch + # Checkout the correct MOM Branch + - name: Handle Pull Request + if: ${{ github.event_name == 'pull_request' }} run: | + echo "Handling pull request" cd $GITHUB_WORKSPACE/cesm3_0_alpha03a/components/mom/ - git checkout main + git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} + git checkout pr-${{ github.event.pull_request.number }} + + - name: Handle Push + if: ${{ github.event_name == 'push' }} + run: | + echo "Handling push" + cd $GITHUB_WORKSPACE/cesm3_0_alpha03a/components/mom/ + git checkout ${{ github.sha }} + - name: Build Standalone MOM run: | cd $GITHUB_WORKSPACE/cesm3_0_alpha03a/components/mom/standalone/build @@ -54,19 +66,17 @@ jobs: with: ## If no one connects after 5 minutes, shut down server. wait-timeout-minutes: 5 - # The takes the build we just made and runs the standalone mom - check_standalone_mom_lightweight_examples: - - runs-on: ubuntu-latest - needs: build_standalone_mom - - steps: - # CDs into a couple MOM examples and runs MOM in them. These are very light weight. - name: Run Double Gyre Test run: | cd $GITHUB_WORKSPACE/cesm3_0_alpha03a/components/mom/standalone/examples/double_gyre $GITHUB_WORKSPACE/cesm3_0_alpha03a/components/mom/standalone/build/gnu/MOM6/MOM6 + - name: Setup upterm session + uses: lhotari/action-upterm@v1 + if: ${{ failure() }} + with: + ## If no one connects after 5 minutes, shut down server. + wait-timeout-minutes: 5 - name: Run Single Column KPP Test run: | cd $GITHUB_WORKSPACE/cesm3_0_alpha03a/components/mom/standalone/examples/single_column/KPP