Skip to content

Commit

Permalink
Merge branch 'develop' into feature/gw-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNew-NOAA committed Nov 6, 2024
2 parents 6713ad1 + 43d8ff6 commit 4c7fe34
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 4 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/run_jcb_basic_testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Run JCB client testing with client changes

on:
push:
branches:
- develop
pull_request:
types:
- opened
- synchronize
- reopened

jobs:

jcb_integration_tests:

runs-on: ubuntu-latest
name: JCB Client Integration Tests

env:
JCB_REPO: https://github.com/NOAA-EMC/jcb.git
JCB_ALGO_REPO: https://github.com/NOAA-EMC/jcb-algorithms.git

steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Determine the name of the algorithm branch
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
JCB_ALGO_BRANCH=${{ github.head_ref }}
else
BRANCH_REF=${{ github.ref }}
JCB_ALGO_BRANCH=${BRANCH_REF#refs/heads/}
fi
echo "JCB_ALGO_BRANCH=$JCB_ALGO_BRANCH" >> $GITHUB_ENV
- name: Check for existence of the branch name in the main jcb repo
run: |
BRANCH_NAME=${{ env.JCB_ALGO_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."
else
# If the tested jcb-algorithms branch does not exist in the main jcb repo then we need to
# throw an error. This is not a safe situation. The developer should create a branch in
# the main jcb repo with the same name as the branch in the jcb-application repo.
# If there were branches in other apps to account for the changes in the algorithm repo
# they could not be tested here since the scipt is not clever enough to check for
# the existence of the branch being tested here in all the clients. The safest thing to do
# is simply create a branch with the same name (even if empty) in the main jcb repo. This
# will ensure the branches of the other applications are checked out by the init script.
echo "The $BRANCH_NAME branch begin tested for jcb-algorithms does not exist in the main "
echo "jcb repo. Please create a branch with the same name in the jcb repo (even if "
echo "empty and without PR). This ensures that where you have made branches with the "
echo "same name in any clients they will be checked out by the cleint intialization "
echo "script."
exit 1
fi
- name: Clone jcb repository
run: |
mkdir -p empty_hooks
git config --global core.hooksPath empty_hooks
git clone --branch ${{ env.JCB_ALGO_BRANCH }} $JCB_REPO jcb_repo
- name: Clone the clients
run: |
cd jcb_repo
pip install pyyaml
./jcb_client_init.py
- name: Install dependencies
run: |
cd jcb_repo
pip install .[testing]
- name: Run the JCB client integration tests
run: |
cd jcb_repo/test/client_integration
pytest -v
4 changes: 2 additions & 2 deletions 3dfgat.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ final:

# Optional final fields to write out
{% if final_increment_to_latlon_file is defined %}
increment to latlon:
increment to structured grid:
{% filter indent(width=4) %}
{% set final_increment_to_latlon_file = final_increment_to_latlon_file ~ '.yaml.j2' %}
{% include final_increment_to_latlon_file %}
{% endfilter %}
{% endif %}

{% if final_analysis_to_latlon_file is defined %}
analysis to latlon:
analysis to structured grid:
{% filter indent(width=4) %}
{% set final_analysis_to_latlon_file = final_analysis_to_latlon_file ~ '.yaml.j2' %}
{% include final_analysis_to_latlon_file %}
Expand Down
4 changes: 2 additions & 2 deletions 3dvar.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ final:

# Optional final fields to write out
{% if final_increment_to_latlon_file is defined %}
increment to latlon:
increment to structured grid:
{% filter indent(width=4) %}
{% set final_increment_to_latlon_file = final_increment_to_latlon_file ~ '.yaml.j2' %}
{% include final_increment_to_latlon_file %}
{% endfilter %}
{% endif %}

{% if final_analysis_to_latlon_file is defined %}
analysis to latlon:
analysis to structured grid:
{% filter indent(width=4) %}
{% set final_analysis_to_latlon_file = final_analysis_to_latlon_file ~ '.yaml.j2' %}
{% include final_analysis_to_latlon_file %}
Expand Down

0 comments on commit 4c7fe34

Please sign in to comment.