Skip to content

Commit

Permalink
Rename CCPP branches from master to main, several small changes in cc…
Browse files Browse the repository at this point in the history
…pp-physics (#572)

* Change CI triggering method #558: CI runs when run-ci label is created
* Remove FMS remnant from compile.sh
* Move load cmake call to after hpc-stack on wcoss_dell_p3
* CDEPS updates

Co-authored-by: MinsukJi-NOAA <minsuk.ji@noaa.gov>
Co-authored-by: Bin Li <bin.li@noaa.gov>
Co-authored-by: Brian Curtis <brian.curtis@noaa.gov>
Co-authored-by: denise.worthen <Denise.Worthen@noaa.gov>
  • Loading branch information
5 people authored May 18, 2021
1 parent 9350745 commit 19e49ec
Show file tree
Hide file tree
Showing 26 changed files with 7,833 additions and 8,449 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/aux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ jobs:
path: ~/id_file
key: helperid-${{ github.event.workflow_run.id }}

- name: Delete run-ci label
run: |
head_sha=${{ github.event.workflow_run.head_sha }}
url=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY
pr_number=$(curl -sS -H $app $url/pulls \
| jq -r '.[] | select(.head.sha == "'"$head_sha"'") | .number')
echo "pr_number is $pr_number"
curl -sS -X DELETE -H $app -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
$url/issues/$pr_number/labels/run-ci
repocheck:
name: Repo check
Expand All @@ -34,28 +44,20 @@ jobs:
steps:
- name: Check up-to-dateness and post comment
run: |
if [[ ${{ github.event.workflow_run.event }} == push ]]; then
echo "This is a push event. No need to check."
comment=''
elif [[ ${{ github.event.workflow_run.event }} == pull_request ]]; then
echo "This is a pull_request event. Check."
head_sha=${{ github.event.workflow_run.head_sha }}
echo "head_sha is $head_sha"
git clone -q ${{ github.event.workflow_run.head_repository.html_url }} .
git checkout -q $head_sha
git submodule -q update --init --recursive
cd ${{ github.workspace }}/tests/ci
url=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY
pr_number=$(curl -sS -H $app $url/pulls \
| jq -r '.[] | select(.head.sha == "'"$head_sha"'") | .number')
echo "pr_number is $pr_number"
pr_uid=${{ github.event.workflow_run.head_repository.owner.login }}
echo "pr_uid is $pr_uid"
comment="$(./repo_check.sh $pr_uid 2>/dev/null)"
echo "comment is $comment"
fi
head_sha=${{ github.event.workflow_run.head_sha }}
git clone -q ${{ github.event.workflow_run.head_repository.html_url }} .
git checkout -q $head_sha
git submodule -q update --init --recursive
cd ${{ github.workspace }}/tests/ci
url=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY
pr_number=$(curl -sS -H $app $url/pulls \
| jq -r '.[] | select(.head.sha == "'"$head_sha"'") | .number')
echo "pr_number is $pr_number"
pr_uid=${{ github.event.workflow_run.head_repository.owner.login }}
echo "pr_uid is $pr_uid"
comment="$(./repo_check.sh $pr_uid 2>/dev/null)"
echo "comment is $comment"
if [[ -n $comment ]]; then
curl -sS -X POST -H $app -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
Expand Down Expand Up @@ -86,7 +88,7 @@ jobs:
run: |
cd ${{ github.workspace }}/tests/ci
eval url=$base_url/${{ github.event.workflow_run.id }}/jobs
b_r=$(echo -n $url | ./check_status.py build $(./setup.py no_builds))
b_r=$(echo -n $url | ./check_status.py build)
if [ $b_r == 'success' ]; then
echo "::set-output name=check::pass"
elif [ $b_r == 'failure' ]; then
Expand Down
41 changes: 4 additions & 37 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Pull Request Tests
on:
push:
branches: ['develop']
pull_request:
branches: ['develop']
types: ['labeled']
env:
app: Accept:application/vnd.github.v3+json

Expand Down Expand Up @@ -53,41 +52,11 @@ jobs:
fi
runcheck:
name: Check if run-ci is requested
runs-on: ubuntu-20.04

outputs:
cirun: ${{ steps.check.outputs.cirun }}

steps:
- name: Check
id: check
run: |
if [[ ${{github.event_name}} == pull_request ]]; then
sha=${{github.event.pull_request.head.sha}}
url=$(echo ${{github.event.pull_request.head.repo.git_commits_url}} \
| sed "s:{/sha}:/$sha:")
elif [[ ${{github.event_name}} == push ]]; then
sha=${{github.event.after}}
url=$(echo ${{github.event.repository.git_commits_url}} | sed "s:{/sha}:/$sha:")
fi
message="$(curl -sS -H "$app" $url | jq '.message')"
echo $message | grep run-ci >/dev/null 2>&1 && d=$? || d=$?
if [[ $d -eq 0 ]]; then
echo "::set-output name=cirun::yes"
elif [[ $d -eq 1 ]]; then
echo "::set-output name=cirun::no"
fi
printf "Commit message is %s\n" "$message"
setup:
name: Configure cases to run
needs: [repocheck,runcheck]
needs: [repocheck]
runs-on: ubuntu-20.04
if: needs.repocheck.outputs.current == 'yes' && needs.runcheck.outputs.cirun == 'yes'
if: needs.repocheck.outputs.current == 'yes' && github.event.label.name == 'run-ci'

outputs:
bld: ${{ steps.parse.outputs.bld }}
Expand All @@ -101,7 +70,7 @@ jobs:
id: parse
run: |
cd ${{ github.workspace }}/tests/ci
IFS='|'; parsed_output=( $(./setup.py cases) )
IFS='|'; parsed_output=( $(./setup.py) )
bld_=${parsed_output[0]}
test_=${parsed_output[1]}
img_=ci-test-weather
Expand All @@ -113,9 +82,7 @@ jobs:
echo "build set : $bld_"
echo "test set : $test_"
echo "image name: $img_"
echo "repocheck: ${{needs.repocheck.outputs.current}}"
echo "runcheck: ${{needs.runcheck.outputs.cirun}}"
build:
Expand Down
2 changes: 1 addition & 1 deletion FV3
3 changes: 1 addition & 2 deletions modulefiles/ufs_wcoss_dell_p3
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ module load python/3.6.3

module use /usrx/local/nceplibs/dev/hpc-stack/libs/hpc-stack/modulefiles/stack

module load cmake/3.20.0

module load hpc/1.1.0
module load cmake/3.20.0
module load hpc-ips/18.0.1.163
module load hpc-impi/18.0.1

Expand Down
3 changes: 1 addition & 2 deletions modulefiles/ufs_wcoss_dell_p3_debug
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ module load python/3.6.3

module use /usrx/local/nceplibs/dev/hpc-stack/libs/hpc-stack/modulefiles/stack

module load cmake/3.20.0

module load hpc/1.1.0
module load cmake/3.20.0
module load hpc-ips/18.0.1.163
module load hpc-impi/18.0.1

Expand Down
Loading

0 comments on commit 19e49ec

Please sign in to comment.