Skip to content

Commit

Permalink
action debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
danholdaway committed May 24, 2024
1 parent 6906a1f commit ade6f8b
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/run_jcb_basic_testing.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run JCB basic testing with client changes
name: Run JCB client testing with client changes

on:
push:
Expand All @@ -18,50 +18,53 @@ 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

- 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: |
Expand Down

0 comments on commit ade6f8b

Please sign in to comment.