PyFV3 unit tests #31
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "PyFV3 unit tests" | |
| # Run these these whenever ... | |
| on: | |
| pull_request: # ... a PR is opened / updated | |
| merge_group: # ... the PR is added to the merge queue | |
| push: | |
| branches: | |
| - main # ... when merging into the main branch | |
| # cancel running jobs if theres a newer push | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: 'recursive' | |
| - name: Setup Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install mpi (MPICH flavor) | |
| run: pip install mpich | |
| - name: Install Python packages | |
| run: pip install .[ndsl,test] | |
| - name: Run serial-cpu tests | |
| run: coverage run --rcfile=pyproject.toml -m pytest tests/main | |
| - name: Run parallel-cpu tests | |
| env: | |
| NDSL_LOGLEVEL: Debug | |
| run: mpiexec -np 9 coverage run --rcfile=pyproject.toml -m mpi4py -m pytest tests/mpi | |
| - name: Output code coverage | |
| run: | | |
| coverage combine | |
| coverage report |