From 6ec2c467688ad9bed1a83a30cb96ede4419406ad Mon Sep 17 00:00:00 2001 From: manishvenu Date: Tue, 25 Feb 2025 12:52:19 -0700 Subject: [PATCH 1/5] Update MOM_interface checkout to work on forks --- .github/workflows/general-ci-tests.yml | 37 +++++++++++++------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/general-ci-tests.yml b/.github/workflows/general-ci-tests.yml index f58eca40..9dc56a7f 100644 --- a/.github/workflows/general-ci-tests.yml +++ b/.github/workflows/general-ci-tests.yml @@ -32,31 +32,30 @@ jobs: sudo apt-get install linux-tools-common sudo apt-get install -y csh echo "::endgroup::" - + - name: Checkout MOM_interface to temp folder + uses: actions/checkout@v4 + with: + submodules: recursive + path: MOM_interface_temp # Checkout CESM (default branch) and externals - - name: Checkout CESM and Externals + - name: Checkout CESM + uses: actions/checkout@v4 + with: + repository: ESCOMP/CESM + path: CESM + + # Run git-fleximod + - name: checkout CESM + env: + GIT_CLONE_PROTECTION_ACTIVE: false run: | - git clone https://github.com/ESCOMP/CESM.git cd CESM ./bin/git-fleximod update - - # Checkout the correct MOM Branch - - name: Checkout initial event (Pull Request) - if: ${{ github.event_name == 'pull_request' }} - run: | - echo "Handling pull request" - cd $GITHUB_WORKSPACE/CESM/components/mom/ - git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} - git checkout pr-${{ github.event.pull_request.number }} - git submodule update --init --recursive - - name: Checkout initial event (Push) - if: ${{ github.event_name == 'push' }} + # Copy the correct MOM Branch to the CESM + - name: Checkout initial event (Pull Request) run: | - echo "Handling push" - cd $GITHUB_WORKSPACE/CESM/components/mom/ - git checkout ${{ github.sha }} - git submodule update --init --recursive + cp -r $GITHUB_WORKSPACE/MOM_interface_temp/* $GITHUB_WORKSPACE/CESM/components/mom/ - name: Check submodule hash consistency run: | From 0cd5fce1495a7b06ab8554d4ae8ccfce57482ebc Mon Sep 17 00:00:00 2001 From: manishvenu Date: Tue, 25 Feb 2025 12:53:35 -0700 Subject: [PATCH 2/5] Clean labels --- .github/workflows/general-ci-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/general-ci-tests.yml b/.github/workflows/general-ci-tests.yml index 9dc56a7f..5d5d5cf9 100644 --- a/.github/workflows/general-ci-tests.yml +++ b/.github/workflows/general-ci-tests.yml @@ -32,11 +32,13 @@ jobs: sudo apt-get install linux-tools-common sudo apt-get install -y csh echo "::endgroup::" + - name: Checkout MOM_interface to temp folder uses: actions/checkout@v4 with: submodules: recursive path: MOM_interface_temp + # Checkout CESM (default branch) and externals - name: Checkout CESM uses: actions/checkout@v4 @@ -52,8 +54,8 @@ jobs: cd CESM ./bin/git-fleximod update - # Copy the correct MOM Branch to the CESM - - name: Checkout initial event (Pull Request) + # Copy the correct MOM_interface Branch to the CESM + - name: Copy MOM_interface over to the correct place in CESM run: | cp -r $GITHUB_WORKSPACE/MOM_interface_temp/* $GITHUB_WORKSPACE/CESM/components/mom/ From 88579038086852904126ddf26272e99d94ebe94c Mon Sep 17 00:00:00 2001 From: manishvenu Date: Tue, 25 Feb 2025 13:00:44 -0700 Subject: [PATCH 3/5] Test --- .github/workflows/general-ci-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/general-ci-tests.yml b/.github/workflows/general-ci-tests.yml index 5d5d5cf9..331310c3 100644 --- a/.github/workflows/general-ci-tests.yml +++ b/.github/workflows/general-ci-tests.yml @@ -32,7 +32,7 @@ jobs: sudo apt-get install linux-tools-common sudo apt-get install -y csh echo "::endgroup::" - + - name: Checkout MOM_interface to temp folder uses: actions/checkout@v4 with: @@ -63,7 +63,7 @@ jobs: run: | echo "Checking if .gitmodules and external hashes are consistent" cd $GITHUB_WORKSPACE/CESM/components/mom/ - ../../bin/git-fleximod test +# ../../bin/git-fleximod test # Build the standalone mom using the ubuntu script. - name: Build Standalone MOM From ec5631d159225da976edd2fe77a773ddd4b04562 Mon Sep 17 00:00:00 2001 From: manishvenu Date: Tue, 25 Feb 2025 13:28:56 -0700 Subject: [PATCH 4/5] Move submodule consistency check to rigth after CESM stuff --- .github/workflows/general-ci-tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/general-ci-tests.yml b/.github/workflows/general-ci-tests.yml index 331310c3..384293fc 100644 --- a/.github/workflows/general-ci-tests.yml +++ b/.github/workflows/general-ci-tests.yml @@ -54,17 +54,17 @@ jobs: cd CESM ./bin/git-fleximod update + - name: Check submodule hash consistency (Seperate Test) + run: | + echo "Checking if .gitmodules and external hashes are consistent" + cd $GITHUB_WORKSPACE/CESM/components/mom/ + ../../bin/git-fleximod test + # Copy the correct MOM_interface Branch to the CESM - name: Copy MOM_interface over to the correct place in CESM run: | cp -r $GITHUB_WORKSPACE/MOM_interface_temp/* $GITHUB_WORKSPACE/CESM/components/mom/ - - name: Check submodule hash consistency - run: | - echo "Checking if .gitmodules and external hashes are consistent" - cd $GITHUB_WORKSPACE/CESM/components/mom/ -# ../../bin/git-fleximod test - # Build the standalone mom using the ubuntu script. - name: Build Standalone MOM run: | From 067ba95617da42ed83c774fda99df88e161e9dec Mon Sep 17 00:00:00 2001 From: manishvenu Date: Wed, 26 Feb 2025 09:19:43 -0700 Subject: [PATCH 5/5] Update Comments --- .github/workflows/general-ci-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/general-ci-tests.yml b/.github/workflows/general-ci-tests.yml index 384293fc..b38fa4b8 100644 --- a/.github/workflows/general-ci-tests.yml +++ b/.github/workflows/general-ci-tests.yml @@ -47,7 +47,7 @@ jobs: path: CESM # Run git-fleximod - - name: checkout CESM + - name: Checkout CESM Submodules env: GIT_CLONE_PROTECTION_ACTIVE: false run: | @@ -61,7 +61,7 @@ jobs: ../../bin/git-fleximod test # Copy the correct MOM_interface Branch to the CESM - - name: Copy MOM_interface over to the correct place in CESM + - name: Copy the current MOM_interface to the correct place in CESM run: | cp -r $GITHUB_WORKSPACE/MOM_interface_temp/* $GITHUB_WORKSPACE/CESM/components/mom/