Skip to content

Commit

Permalink
add support for overriding METplotpy, METcalcpy, and METdataio branch…
Browse files Browse the repository at this point in the history
… for testing workflow
  • Loading branch information
georgemccabe committed Feb 12, 2025
1 parent a700167 commit a5797cc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
15 changes: 15 additions & 0 deletions .github/actions/run_tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,24 @@ inputs:
categories:
description: 'Use case category or categories to run (separate by comma)'
required: true
metplotpy_branch:
description: 'Branch to use for METplotpy (default is determined by METplus version)'
required: false
default: ''
metcalcpy_branch:
description: 'Branch to use for METcalcpy (default is determined by METplus version)'
required: false
default: ''
metdataio_branch:
description: 'Branch to use for METdataio (default is determined by METplus version)'
required: false
default: ''

runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.categories }}
- ${{ inputs.metplotpy_branch }}
- ${{ inputs.metcalcpy_branch }}
- ${{ inputs.metdataio_branch }}
13 changes: 8 additions & 5 deletions .github/jobs/get_use_case_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,14 @@ def handle_automation_env(host_name, reqs):

setup_env.append(f'cd {METPLUS_DOCKER_LOC}/..')
for component in components:
version = get_component_version(input_component='METplus',
input_version=metplus_version,
output_component=component,
output_format='main_v{X}.{Y}',
get_dev=False)
# get branch if defined, otherwise determine from METplus version
version = os.environ.get(f'INPUT_{component.upper()}_BRANCH')
if not version:
version = get_component_version(input_component='METplus',
input_version=metplus_version,
output_component=component,
output_format='main_v{X}.{Y}',
get_dev=False)
setup_env.extend((
'git --version',
f'git clone --single-branch --branch {version} https://github.com/dtcenter/{component}',
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ on:
description: 'User that triggered the event (used by external repo triggering)'
pusher_email:
description: 'Email address of user who triggered push event (used by external repo triggering)'
metplotpy_branch:
description: 'METplotpy branch to use (default is develop or main_vX.Y)'
metcalcpy_branch:
description: 'METcalcpy branch to use (default is develop or main_vX.Y)'
metdataio_branch:
description: 'METdataio branch to use (default is develop or main_vX.Y)'

jobs:

Expand Down Expand Up @@ -190,6 +196,9 @@ jobs:
id: run_tests
with:
categories: ${{ matrix.categories }}
metplotpy_branch: ${{ github.event.inputs.metplotpy_branch }}
metcalcpy_branch: ${{ github.event.inputs.metcalcpy_branch }}
metdataio_branch: ${{ github.event.inputs.metdataio_branch }}

# copy logs with errors to error_logs directory to save as artifact
- name: Save error logs
Expand Down

0 comments on commit a5797cc

Please sign in to comment.