Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reusable workflow CI - checkout corrrect repository #25

Merged
merged 15 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/lint.yml → .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: "Lint"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
lint:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pace_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "Pace unit tests"
name: "pace main tests"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
pace_unit_tests:
pace_main_tests:
uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop
with:
fv3_trigger: true
component_trigger: true
component_name: pyFV3
6 changes: 3 additions & 3 deletions .github/workflows/pyshield_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "pySHiELD Translate tests"
name: "pySHiELD translate tests"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
pyshield_translate_tests:
uses: NOAA-GFDL/PySHiELD/.github/workflows/translate.yaml@develop
with:
fv3_trigger: true
component_trigger: true
component_name: pyFV3
59 changes: 27 additions & 32 deletions .github/workflows/translate.yaml
Original file line number Diff line number Diff line change
@@ -1,73 +1,67 @@
name: "Translate PyFV3 test (subset)"
name: "pyFV3 translate tests (subset)"
on:
workflow_call:
inputs:
ndsl_trigger:
component_trigger:
type: boolean
default: false
required: true
required: false
component_name:
type: string
default: ''
required: false
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

# cancel running jobs if theres a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
github_repository: ${{github.event.repository.name}}

jobs:
pyFV3_translate_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/miniforge:mpich
steps:

- name: Checkout PyFV3 for external trigger
if: ${{inputs.ndsl_trigger}}
- name: External trigger Checkout pyFV3
if: ${{inputs.component_trigger}}
uses: actions/checkout@v4
with:
submodules: 'recursive'
repository: noaa-gfdl/PyFV3
path: PyFV3
repository: noaa-gfdl/pyFV3
path: pyFV3

- name: Checkout repository that triggers workflow
- name: Checkout hash that triggered CI
uses: actions/checkout@v4
with:
submodules: 'recursive'
path: ${{env.github_repository}}

- name: mv NDSL to PyFV3 if NDSL triggers test
if: ${{inputs.ndsl_trigger}}
run: |
cd ${GITHUB_WORKSPACE}
mv ${{env.github_repository}} PyFV3/.
path: pyFV3/${{inputs.component_name}}

- name: install packages to test NDSL in PyFV3
if: ${{inputs.ndsl_trigger}}
- name: External trigger install NDSL packages
if: ${{inputs.component_trigger}}
run: |
cd ${GITHUB_WORKSPACE}/PyFV3
cd NDSL && pip3 install .[test]
cd .. && pip3 install .[test]
cd ${GITHUB_WORKSPACE}/pyFV3
cd NDSL && pip3 install .[test] && cd ../
pip3 install .[test]

- name: Install pyFV3 packages ofr !ndsl_trigger
if: ${{ ! inputs.ndsl_trigger }}
- name: Install pyFV3 packages
if: ${{ ! inputs.component_trigger }}
run : |
cd ${GITHUB_WORKSPACE}/PyFV3
cd ${GITHUB_WORKSPACE}/pyFV3
pip install .[ndsl,test]

- name: Prepare test_data
run: |
cd ${GITHUB_WORKSPACE}/PyFV3
cd ${GITHUB_WORKSPACE}/pyFV3
mkdir -p test_data && cd test_data
wget https://portal.nccs.nasa.gov/datashare/astg/smt/pace-regression-data/8.1.3_c12_6ranks_standard.tar.gz
tar -xzvf 8.1.3_c12_6ranks_standard.tar.gz --no-same-owner
cd ..

- name: NumPy FvTp2d
run: |
cd ${GITHUB_WORKSPACE}/PyFV3
cd ${GITHUB_WORKSPACE}/pyFV3
pytest \
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \
--backend=numpy \
Expand All @@ -77,7 +71,7 @@ jobs:

- name: Numpy D_SW
run: |
cd ${GITHUB_WORKSPACE}/PyFV3
cd ${GITHUB_WORKSPACE}/pyFV3
pytest \
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \
--backend=numpy \
Expand All @@ -87,16 +81,17 @@ jobs:

- name: Numpy Remapping
run: |
cd ${GITHUB_WORKSPACE}/PyFV3
cd ${GITHUB_WORKSPACE}/pyFV3
pytest \
-v -s --data_path=./test_data/8.1.3/c12_6ranks_standard/dycore \
--backend=numpy \
--which_modules=Remapping \
--threshold_overrides_file=./tests/savepoint/translate/overrides/standard.yaml \
./tests/savepoint

- name: Orchestrated dace-cpu Acoustics
run: |
cd ${GITHUB_WORKSPACE}/PyFV3
cd ${GITHUB_WORKSPACE}/pyFV3
export FV3_DACEMODE=BuildAndRun
export PACE_FLOAT_PRECISION=64
export PACE_TEST_N_THRESHOLD_SAMPLES=0
Expand Down
Loading