Skip to content

Commit

Permalink
Merge pull request #51 from mlee03/ci-testing
Browse files Browse the repository at this point in the history
Containerized CI and expansion to trigger external tests
  • Loading branch information
fmalatino authored Jul 11, 2024
2 parents 9afe641 + 24b8675 commit cbe983d
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 21 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/fv3_translate_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "FV3 translate tests"
on:
pull_request:

jobs:
fv3_translate_tests:
uses: NOAA-GFDL/pyFV3/.github/workflows/translate.yaml@develop
with:
component_trigger: true
component_name: NDSL
6 changes: 5 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: "Lint"
on:
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

jobs:
lint:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/pace_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "pace main tests"
on:
pull_request:

jobs:
pace_main_tests:
uses: NOAA-GFDL/pace/.github/workflows/main_unit_tests.yaml@develop
with:
component_trigger: true
component_name: NDSL
10 changes: 10 additions & 0 deletions .github/workflows/shield_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "SHiELD Translate tests"
on:
pull_request:

jobs:
shield_translate_tests:
uses: NOAA-GFDL/pySHiELD/.github/workflows/translate.yaml@develop
with:
component_trigger: true
component_name: NDSL
37 changes: 17 additions & 20 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
name: "Unit tests"
name: "NDSL unit tests"
on:
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

jobs:
all:
ndsl_unit_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.11.7]
container:
image: ghcr.io/noaa-gfdl/miniforge:mpich
steps:

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Python
uses: actions/setup-python@v4.6.0
with:
python-version: ${{ matrix.python }}
- name: Install OpenMPI & Boost for gt4py
run: |
sudo apt-get install libopenmpi-dev libboost1.74-dev

- name: Install Python packages
run: |
python -m pip install --upgrade pip setuptools wheel
pip install .[test]
run: pip3 install .[test]

- name: Run serial-cpu tests
run: |
coverage run --rcfile=setup.cfg -m pytest -x tests
run: coverage run --rcfile=setup.cfg -m pytest -x tests

- name: Run parallel-cpu tests
run: |
mpirun -np 6 --oversubscribe coverage run --rcfile=setup.cfg -m mpi4py -m pytest -x tests/mpi
run: mpiexec -np 6 --oversubscribe coverage run --rcfile=setup.cfg -m mpi4py -m pytest -x tests/mpi

- name: Output code coverage
run: |
coverage combine
Expand Down

0 comments on commit cbe983d

Please sign in to comment.