Skip to content

Commit fd67bfa

Browse files
authored
ci: expose python version for translate tests (#178)
With NDSL supporting more than one version of python, we'd like to have the possibility to run pyFV3 translate tests with different versions of python. This PR adds an optional input variable to the `workflow_call` which allows calling workflows to specify the python version. The PR also removes usage of the `component_trigger` input variable. The input is redundant with `component_name`, which is a non-empty string whenever `component_trigger` is true. I keep the input around until we update all calling workflows to not set it anymore. Co-authored-by: Roman Cattaneo <>
1 parent e632e01 commit fd67bfa

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/main_unit_tests.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
type: string
1313
default: ''
1414
required: false
15+
python_version:
16+
type: string
17+
default: ''
18+
required: false
1519
pull_request: # ... a PR is opened / updated
1620
merge_group: # ... the PR is added to the merge queue
1721
push:
@@ -29,20 +33,23 @@ jobs:
2933
defaults:
3034
run:
3135
shell: bash -el {0}
36+
env:
37+
python_default: '3.11'
38+
3239
steps:
3340
- name: "External trigger: Checkout pace/develop"
34-
if: ${{ inputs.component_trigger }}
41+
if: ${{ inputs.component_name }}
3542
uses: actions/checkout@v6
3643
with:
3744
submodules: 'recursive'
3845
repository: NOAA-GFDL/pace
3946
path: pace
4047
ref: develop
4148

42-
- name: Setup Python 3.11
49+
- name: 'Setup Python ${{ inputs.python_version && inputs.python_version || env.python_default }}'
4350
uses: actions/setup-python@v6
4451
with:
45-
python-version: '3.11'
52+
python-version: ${{ inputs.python_version && inputs.python_version || env.python_default }}
4653

4754
- name: Install mpi (MPICH flavor)
4855
run: pip install mpich
@@ -55,7 +62,7 @@ jobs:
5562
run: pip install numpy==1.26.4
5663

5764
- name: "External trigger: Remove existing component in pace/develop"
58-
if: ${{ inputs.component_trigger }}
65+
if: ${{ inputs.component_name }}
5966
run: rm -rf ${GITHUB_WORKSPACE}/pace/${{inputs.component_name}}
6067

6168
- name: Checkout out hash that triggered CI

0 commit comments

Comments
 (0)