Skip to content

Commit

Permalink
Remove branch_checkout logic and fix branch handling error in CI sc…
Browse files Browse the repository at this point in the history
…ript (#34)

* Remove branch_checkout logic once and for all

* Bug fix for ufs-bundle branch name in .github/workflows/run_ec2_pcluster.yaml

* No extra ufs-bundle-branch logic needed

* Remove more stuff
  • Loading branch information
climbfuji authored Jul 21, 2023
1 parent 7f120a5 commit 03c5ae7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/run_ec2_pcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ on:
# pull request to develop
branches: [develop]
workflow_dispatch:
inputs:
ufs-bundle-branch:
description: 'The ufs-bundle branch to use. Default is "develop"'
required: true
default: 'develop'

defaults:
run:
Expand Down Expand Up @@ -112,23 +107,24 @@ jobs:
- name: clone-build-bundle
env:
JEDI_ENV: /home/ubuntu/ufs-bundle/jedi_run
UFS_BUNDLE_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
# In run directory
cd ${JEDI_ENV}
# Set environment
source setup.sh
echo "Using branch ${{ inputs.ufs-bundle-branch || 'develop' }} for ufs-bundle"
echo "Using branch ${UFS_BUNDLE_BRANCH_NAME} for ufs-bundle"
if [ -d ufs-bundle ] ; then
echo "Update existing copy of ufs-bundle"
cd ufs-bundle
git remote update
git checkout origin/${{ inputs.ufs-bundle-branch || 'develop' }}
git checkout origin/${UFS_BUNDLE_BRANCH_NAME}
cd ..
else
echo "Check out a fresh copy of ufs-bundle"
git clone -b ${{ inputs.ufs-bundle-branch || 'develop' }} https://github.com/jcsda/ufs-bundle
git clone -b ${UFS_BUNDLE_BRANCH_NAME} https://github.com/jcsda/ufs-bundle
fi
# UFS_APP=ATM
Expand Down
27 changes: 3 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -174,45 +174,24 @@ endif()
# ioda, ufo and fv3-jedi test data
#----------------------------------------

# If IODA branch is being built set GIT_BRANCH_FUNC to IODA's current branch.
# If a tagged version of IODA is being built set GIT_TAG_FUNC to ioda's current tag. In this case,
# IODA test files will be download from UCAR DASH and ioda-data repo will not be cloned.
# When LOCAL_PATH_JEDI_TESTFILES is set to the directory of IODA test files stored
# in a local directory, ioda-data repo will not be cloned

find_branch_name(REPO_DIR_NAME ioda)
# When LOCAL_PATH_JEDI_TESTFILES is set to the directory of IODA test files stored
# in a local directory, ioda-data repo will not be cloned
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} )
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} )
ecbuild_bundle( PROJECT ioda-data GIT "https://github.com/JCSDA-internal/ioda-data.git" BRANCH develop UPDATE )
endif()

# If IODA's current branch is available in ioda-data repo, that branch will be checked out
branch_checkout (REPO_DIR_NAME ioda-data
BRANCH ${GIT_BRANCH_FUNC} )

# same procedure for ufo-data
find_branch_name(REPO_DIR_NAME ufo)
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} )
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} )
ecbuild_bundle( PROJECT ufo-data GIT "https://github.com/JCSDA-internal/ufo-data.git" BRANCH develop UPDATE )
endif()

# If UFO's current branch is available in ufo-data repo, that branch will be checked out
branch_checkout (REPO_DIR_NAME ufo-data
BRANCH ${GIT_BRANCH_FUNC} )

# same procedure for fv3-jedi-data
find_branch_name(REPO_DIR_NAME fv3-jedi)
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} AND NOT DEFINED ${GIT_TAG_FUNC} )
if( NOT DEFINED ENV{LOCAL_PATH_JEDI_TESTFILES} )
# DH* 20230718 revert this to feature/ufs_dom once https://github.com/JCSDA-internal/fv3-jedi-data/pull/78 is merged
ecbuild_bundle( PROJECT fv3-jedi-data GIT "https://github.com/JCSDA-internal/fv3-jedi-data.git" BRANCH feature/ufs_dom_update_ufswm_20230717 )
# *DH 20230718
endif()

# If fv3-jedi's current branch is available in fv3-jedi-data repo, that branch will be checked out
branch_checkout (REPO_DIR_NAME fv3-jedi-data
BRANCH ${GIT_BRANCH_FUNC} )

# Build Doxygen documentation
# ---------------------------
option(BUILD_UFSJEDI_BUNDLE_DOC "Build documentation" OFF)
Expand Down

0 comments on commit 03c5ae7

Please sign in to comment.