From d61e590b76da2f698a7a1f67eebf40eceb9ad07b Mon Sep 17 00:00:00 2001 From: danholdaway Date: Thu, 23 May 2024 16:43:45 -0400 Subject: [PATCH 01/19] action testing --- .github/run_jcb_basic_testing.yaml | 62 ++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/run_jcb_basic_testing.yaml diff --git a/.github/run_jcb_basic_testing.yaml b/.github/run_jcb_basic_testing.yaml new file mode 100644 index 0000000..8e9b500 --- /dev/null +++ b/.github/run_jcb_basic_testing.yaml @@ -0,0 +1,62 @@ +name: Run JCB basic testing with jcb-gdas changes + +on: + push: + branches: + - develop + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + test: + runs-on: ubuntu-latest + + env: + JCB_REPO: https://github.com/NOAA-EMC/jcb.git + JCB_DEVELOP_BRANCH: develop + + steps: + - name: Checkout submodule repository + uses: actions/checkout@v3 + with: + submodules: true + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' # specify your python version + + - name: Determine branch to use + id: determine-branch + run: | + # Determine if the branch exists in the jcb repo + BRANCH_NAME=${{ github.ref_name }} + git ls-remote --exit-code --heads $JCB_REPO $BRANCH_NAME + if [ $? -eq 0 ]; then + echo "Branch $BRANCH_NAME exists in jcb repo." + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + else + echo "Branch $BRANCH_NAME does not exist in jcb repo. Using develop branch." + echo "BRANCH_NAME=$JCB_DEVELOP_BRANCH" >> $GITHUB_ENV + fi + + - name: Clone jcb repository + run: | + echo "BRANCH_NAME=${{ env.BRANCH_NAME }}" + git clone --branch ${{ env.BRANCH_NAME }} $JCB_REPO jcb_repo + cd jcb_repo/src/jcb/configuration/apps/gdas + git checkout ${{ env.BRANCH_NAME }} + cd - + + - name: Install dependencies + run: | + cd jcb_repo + pip install .[testing] + + - name: Run unit tests + run: | + cd $GITHUB_WORKSPACE + pytest -v From ddaad0e25e072de9453ccb0e246c4c423b6470f1 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:04:23 -0400 Subject: [PATCH 02/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index de73834..5253e2a 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -34,6 +34,7 @@ jobs: run: | # Determine if the branch exists in the jcb repo BRANCH_NAME=${{ github.ref_name }} + echo "BRANCH NAME IS $BRANCH_NAME" git ls-remote --exit-code --heads $JCB_REPO $BRANCH_NAME if [ $? -eq 0 ]; then echo "Branch $BRANCH_NAME exists in jcb repo." From 68fcc34d07fb130918cfabb78d200f16c47cb4f6 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:18:05 -0400 Subject: [PATCH 03/19] action debugging --- .github/run_jcb_basic_testing.yaml | 62 -------------------- .github/workflows/run_jcb_basic_testing.yaml | 3 +- 2 files changed, 2 insertions(+), 63 deletions(-) delete mode 100644 .github/run_jcb_basic_testing.yaml diff --git a/.github/run_jcb_basic_testing.yaml b/.github/run_jcb_basic_testing.yaml deleted file mode 100644 index 8e9b500..0000000 --- a/.github/run_jcb_basic_testing.yaml +++ /dev/null @@ -1,62 +0,0 @@ -name: Run JCB basic testing with jcb-gdas changes - -on: - push: - branches: - - develop - pull_request: - types: - - opened - - synchronize - - reopened - -jobs: - test: - runs-on: ubuntu-latest - - env: - JCB_REPO: https://github.com/NOAA-EMC/jcb.git - JCB_DEVELOP_BRANCH: develop - - steps: - - name: Checkout submodule repository - uses: actions/checkout@v3 - with: - submodules: true - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' # specify your python version - - - name: Determine branch to use - id: determine-branch - run: | - # Determine if the branch exists in the jcb repo - BRANCH_NAME=${{ github.ref_name }} - git ls-remote --exit-code --heads $JCB_REPO $BRANCH_NAME - if [ $? -eq 0 ]; then - echo "Branch $BRANCH_NAME exists in jcb repo." - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - else - echo "Branch $BRANCH_NAME does not exist in jcb repo. Using develop branch." - echo "BRANCH_NAME=$JCB_DEVELOP_BRANCH" >> $GITHUB_ENV - fi - - - name: Clone jcb repository - run: | - echo "BRANCH_NAME=${{ env.BRANCH_NAME }}" - git clone --branch ${{ env.BRANCH_NAME }} $JCB_REPO jcb_repo - cd jcb_repo/src/jcb/configuration/apps/gdas - git checkout ${{ env.BRANCH_NAME }} - cd - - - - name: Install dependencies - run: | - cd jcb_repo - pip install .[testing] - - - name: Run unit tests - run: | - cd $GITHUB_WORKSPACE - pytest -v diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 5253e2a..1948236 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -16,6 +16,7 @@ jobs: env: JCB_REPO: https://github.com/NOAA-EMC/jcb.git + JCB_APP_REPO: https://github.com/NOAA-EMC/jcb-gdas.git JCB_DEVELOP_BRANCH: develop steps: @@ -33,7 +34,7 @@ jobs: id: determine-branch run: | # Determine if the branch exists in the jcb repo - BRANCH_NAME=${{ github.ref_name }} + BRANCH_NAME=${{ github.ref }} echo "BRANCH NAME IS $BRANCH_NAME" git ls-remote --exit-code --heads $JCB_REPO $BRANCH_NAME if [ $? -eq 0 ]; then From b04477d40f7392c2ebde6dfb545559e35c11ce1e Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:20:49 -0400 Subject: [PATCH 04/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 1948236..c6765d9 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -33,6 +33,14 @@ jobs: - name: Determine branch to use id: determine-branch run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + BRANCH_NAME=${{ github.head_ref }} + else + BRANCH_REF=${{ github.ref }} + BRANCH_NAME=${BRANCH_REF#refs/heads/} + fi + echo "Branch name: $BRANCH_NAME" + # Determine if the branch exists in the jcb repo BRANCH_NAME=${{ github.ref }} echo "BRANCH NAME IS $BRANCH_NAME" From 33f40de08c9f69e26ceba25825075efb900ae791 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:22:30 -0400 Subject: [PATCH 05/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index c6765d9..200ad11 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -40,9 +40,6 @@ jobs: BRANCH_NAME=${BRANCH_REF#refs/heads/} fi echo "Branch name: $BRANCH_NAME" - - # Determine if the branch exists in the jcb repo - BRANCH_NAME=${{ github.ref }} echo "BRANCH NAME IS $BRANCH_NAME" git ls-remote --exit-code --heads $JCB_REPO $BRANCH_NAME if [ $? -eq 0 ]; then From ec4daddb26de43b4a32d11ff467c3ae61882f3b9 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:28:00 -0400 Subject: [PATCH 06/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 200ad11..baa7665 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -39,20 +39,18 @@ jobs: BRANCH_REF=${{ github.ref }} BRANCH_NAME=${BRANCH_REF#refs/heads/} fi - echo "Branch name: $BRANCH_NAME" - echo "BRANCH NAME IS $BRANCH_NAME" - git ls-remote --exit-code --heads $JCB_REPO $BRANCH_NAME - if [ $? -eq 0 ]; then + + if git ls-remote --heads $REPO_URL $BRANCH_NAME | grep -q "refs/heads/$BRANCH_NAME"; then echo "Branch $BRANCH_NAME exists in jcb repo." - echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + echo "JCB_BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV else echo "Branch $BRANCH_NAME does not exist in jcb repo. Using develop branch." - echo "BRANCH_NAME=$JCB_DEVELOP_BRANCH" >> $GITHUB_ENV + echo "JCB_BRANCH_NAME=develop" >> $GITHUB_ENV fi - name: Clone jcb repository run: | - git clone --branch ${{ env.BRANCH_NAME }} $JCB_REPO jcb_repo + git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo cd jcb_repo/src/jcb/configuration/apps/gdas git checkout ${{ env.BRANCH_NAME }} cd - From e1d3dac484f948853e646a0ceafff6df4bd6512e Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:29:29 -0400 Subject: [PATCH 07/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index baa7665..1cebd20 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -40,7 +40,7 @@ jobs: BRANCH_NAME=${BRANCH_REF#refs/heads/} fi - if git ls-remote --heads $REPO_URL $BRANCH_NAME | grep -q "refs/heads/$BRANCH_NAME"; then + if git ls-remote --heads $JCB_REPO $BRANCH_NAME | grep -q "refs/heads/$BRANCH_NAME"; then echo "Branch $BRANCH_NAME exists in jcb repo." echo "JCB_BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV else From f99052767fd400a6d7659598526ece9038e82599 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:31:56 -0400 Subject: [PATCH 08/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 1cebd20..206d3ff 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -50,6 +50,7 @@ jobs: - name: Clone jcb repository run: | + GIT_CLONE_PROTECTION_ACTIVE=false git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo cd jcb_repo/src/jcb/configuration/apps/gdas git checkout ${{ env.BRANCH_NAME }} From 454c4c0825965949e2ff742a6526929dd0d3b098 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:33:03 -0400 Subject: [PATCH 09/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 206d3ff..f82b452 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -50,7 +50,8 @@ jobs: - name: Clone jcb repository run: | - GIT_CLONE_PROTECTION_ACTIVE=false + mkdir -p empty_hooks + git config --global core.hooksPath empty_hooks git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo cd jcb_repo/src/jcb/configuration/apps/gdas git checkout ${{ env.BRANCH_NAME }} From ffb7c2d4ee065a9a52ea9d67abc0ab63d986b311 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:35:43 -0400 Subject: [PATCH 10/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index f82b452..aa6d53e 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -55,6 +55,9 @@ jobs: git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo cd jcb_repo/src/jcb/configuration/apps/gdas git checkout ${{ env.BRANCH_NAME }} + echo `git rev-parse HEAD` + git branch + ls -l cd - - name: Install dependencies From 5d3ab7b10bf9ffdb5e9cdd4207982b97087727a9 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:44:04 -0400 Subject: [PATCH 11/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index aa6d53e..7bdaf3b 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -16,8 +16,6 @@ jobs: env: JCB_REPO: https://github.com/NOAA-EMC/jcb.git - JCB_APP_REPO: https://github.com/NOAA-EMC/jcb-gdas.git - JCB_DEVELOP_BRANCH: develop steps: - name: Checkout submodule repository @@ -40,6 +38,8 @@ jobs: BRANCH_NAME=${BRANCH_REF#refs/heads/} fi + echo "JCB_APP_BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + if git ls-remote --heads $JCB_REPO $BRANCH_NAME | grep -q "refs/heads/$BRANCH_NAME"; then echo "Branch $BRANCH_NAME exists in jcb repo." echo "JCB_BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV @@ -54,7 +54,7 @@ jobs: git config --global core.hooksPath empty_hooks git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo cd jcb_repo/src/jcb/configuration/apps/gdas - git checkout ${{ env.BRANCH_NAME }} + git checkout ${{ env.JCB_APP_BRANCH_NAME }} echo `git rev-parse HEAD` git branch ls -l @@ -65,7 +65,8 @@ jobs: cd jcb_repo pip install .[testing] - - name: Run unit tests + - name: Run the JCB client integration tests run: | cd $GITHUB_WORKSPACE + cd test/client_integration pytest -v From 0f9b01131a6dd8bf93dc75d32b396c9d98d95284 Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 09:47:15 -0400 Subject: [PATCH 12/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 7bdaf3b..99a703c 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -55,10 +55,6 @@ jobs: git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo cd jcb_repo/src/jcb/configuration/apps/gdas git checkout ${{ env.JCB_APP_BRANCH_NAME }} - echo `git rev-parse HEAD` - git branch - ls -l - cd - - name: Install dependencies run: | @@ -67,6 +63,5 @@ jobs: - name: Run the JCB client integration tests run: | - cd $GITHUB_WORKSPACE - cd test/client_integration + cd jcb_repo/test/client_integration pytest -v From b19a6aee0111cf73e5e9c5c919e1e93b052d0e2b Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 10:30:29 -0400 Subject: [PATCH 13/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 99a703c..ddaf929 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -1,4 +1,4 @@ -name: Run JCB basic testing with jcb-gdas changes +name: Run JCB basic testing with client changes on: push: @@ -16,6 +16,7 @@ jobs: env: JCB_REPO: https://github.com/NOAA-EMC/jcb.git + JCB_APP_REPO: "https://github.com/${GITHUB_REPOSITORY}" steps: - name: Checkout submodule repository @@ -53,7 +54,11 @@ jobs: mkdir -p empty_hooks git config --global core.hooksPath empty_hooks git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo - cd jcb_repo/src/jcb/configuration/apps/gdas + + cd jcb_repo + python get_submod_path.py $JCB_APP_REPO > SUBMODPATH + SUBMODPATH=$(cat SUBMODPATH) + cd $SUBMODPATH git checkout ${{ env.JCB_APP_BRANCH_NAME }} - name: Install dependencies From 46c791c04fb2dc35c769ca7cd23c36fd2c5d230c Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 10:34:01 -0400 Subject: [PATCH 14/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index ddaf929..c6e2da8 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -16,7 +16,6 @@ jobs: env: JCB_REPO: https://github.com/NOAA-EMC/jcb.git - JCB_APP_REPO: "https://github.com/${GITHUB_REPOSITORY}" steps: - name: Checkout submodule repository @@ -29,6 +28,11 @@ jobs: with: python-version: '3.x' # specify your python version + - name: Add repo url to the environment + run: | + echo ${{ github.repository }} + echo "JCB_APP_REPO=${{ github.repository }}" >> $GITHUB_ENV + - name: Determine branch to use id: determine-branch run: | From 7e2d65ebe8a53c80566743e2a9a84442d92d158b Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 10:35:15 -0400 Subject: [PATCH 15/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index c6e2da8..81169d6 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -30,8 +30,8 @@ jobs: - name: Add repo url to the environment run: | - echo ${{ github.repository }} - echo "JCB_APP_REPO=${{ github.repository }}" >> $GITHUB_ENV + echo "https://github.com/${{ github.repository }}" + echo "JCB_APP_REPO="https://github.com/${{ github.repository }}" >> $GITHUB_ENV - name: Determine branch to use id: determine-branch From a91b81fc135872631215140a2c5495e22bbc675d Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 10:37:04 -0400 Subject: [PATCH 16/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 81169d6..646224c 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -30,8 +30,8 @@ jobs: - name: Add repo url to the environment run: | - echo "https://github.com/${{ github.repository }}" - echo "JCB_APP_REPO="https://github.com/${{ github.repository }}" >> $GITHUB_ENV + JCB_APP_REPO="https://github.com/${{ github.repository }}" + echo "JCB_APP_REPO=${JCB_APP_REPO}" >> $GITHUB_ENV - name: Determine branch to use id: determine-branch From b66c34cdc0eaf80eaf4c40b1d82fae6bf97db6be Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 10:39:27 -0400 Subject: [PATCH 17/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 646224c..68c96ba 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -62,6 +62,7 @@ jobs: cd jcb_repo python get_submod_path.py $JCB_APP_REPO > SUBMODPATH SUBMODPATH=$(cat SUBMODPATH) + echo $SUBMODPATH cd $SUBMODPATH git checkout ${{ env.JCB_APP_BRANCH_NAME }} From 6906a1faefaa15bb140a1148a9fc216e7d5fbdda Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 10:47:27 -0400 Subject: [PATCH 18/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 68c96ba..8bb388b 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -60,10 +60,7 @@ jobs: git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo cd jcb_repo - python get_submod_path.py $JCB_APP_REPO > SUBMODPATH - SUBMODPATH=$(cat SUBMODPATH) - echo $SUBMODPATH - cd $SUBMODPATH + cd $(python get_submod_path.py $JCB_APP_REPO) git checkout ${{ env.JCB_APP_BRANCH_NAME }} - name: Install dependencies From ade6f8b3cfc73a1646ea7fa293a2aeaa152fbebe Mon Sep 17 00:00:00 2001 From: danholdaway Date: Fri, 24 May 2024 10:56:24 -0400 Subject: [PATCH 19/19] action debugging --- .github/workflows/run_jcb_basic_testing.yaml | 29 +++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run_jcb_basic_testing.yaml b/.github/workflows/run_jcb_basic_testing.yaml index 8bb388b..283ba9a 100644 --- a/.github/workflows/run_jcb_basic_testing.yaml +++ b/.github/workflows/run_jcb_basic_testing.yaml @@ -1,4 +1,4 @@ -name: Run JCB basic testing with client changes +name: Run JCB client testing with client changes on: push: @@ -18,7 +18,7 @@ jobs: JCB_REPO: https://github.com/NOAA-EMC/jcb.git steps: - - name: Checkout submodule repository + - name: Checkout application client repository uses: actions/checkout@v3 with: submodules: true @@ -26,42 +26,45 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.x' # specify your python version + python-version: '3.x' - name: Add repo url to the environment run: | JCB_APP_REPO="https://github.com/${{ github.repository }}" echo "JCB_APP_REPO=${JCB_APP_REPO}" >> $GITHUB_ENV - - name: Determine branch to use - id: determine-branch + - name: Determine the name of the client branch run: | if [ "${{ github.event_name }}" == "pull_request" ]; then - BRANCH_NAME=${{ github.head_ref }} + JCB_APP_BRANCH=${{ github.head_ref }} else BRANCH_REF=${{ github.ref }} - BRANCH_NAME=${BRANCH_REF#refs/heads/} + JCB_APP_BRANCH=${BRANCH_REF#refs/heads/} fi + echo "JCB_APP_BRANCH=$JCB_APP_BRANCH" >> $GITHUB_ENV - echo "JCB_APP_BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV - + - name: Determine branch to use for main jcb repo + run: | + BRANCH_NAME=${{ env.JCB_APP_BRANCH }} if git ls-remote --heads $JCB_REPO $BRANCH_NAME | grep -q "refs/heads/$BRANCH_NAME"; then echo "Branch $BRANCH_NAME exists in jcb repo." - echo "JCB_BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + echo "JCB_BRANCH=$BRANCH_NAME" >> $GITHUB_ENV else echo "Branch $BRANCH_NAME does not exist in jcb repo. Using develop branch." - echo "JCB_BRANCH_NAME=develop" >> $GITHUB_ENV + echo "JCB_BRANCH=develop" >> $GITHUB_ENV fi - name: Clone jcb repository run: | mkdir -p empty_hooks git config --global core.hooksPath empty_hooks - git clone --branch ${{ env.JCB_BRANCH_NAME }} --recursive $JCB_REPO jcb_repo + git clone --branch ${{ env.JCB_BRANCH }} --recursive $JCB_REPO jcb_repo + - name: Switch the application branch to match the action + run: | cd jcb_repo cd $(python get_submod_path.py $JCB_APP_REPO) - git checkout ${{ env.JCB_APP_BRANCH_NAME }} + git checkout ${{ env.JCB_APP_BRANCH }} - name: Install dependencies run: |