add yaml parser #1297
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: Testing | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| - '!joss-paper' | |
| pull_request: | |
| jobs: | |
| formatting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: psf/black@stable | |
| with: | |
| src: "./regional_mom6 ./tests" | |
| testing: | |
| needs: formatting | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/cosima/regional-test-env:latest | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - name: Set git config | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "github-actions@github.com" | |
| git config --global --add safe.directory '*' | |
| - uses: actions/checkout@v3 | |
| - name: Fix git stuff | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "github-actions@github.com" | |
| git config --global --add safe.directory '*' | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| miniconda-version: "latest" | |
| auto-update-conda: true | |
| auto-activate-base: false | |
| environment-file: environment-ci.yml | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install from source | |
| run: | | |
| python -m pip install . | |
| - name: Install pytest | |
| run: | | |
| python -m pip install pytest pytest-cov nbval | |
| - name: Test with pytest | |
| run: | | |
| if [[ "${{ matrix.python-version }}" == "3.10" ]]; then | |
| python -m pytest -v --doctest-modules --cov=regional_mom6 --cov-report=xml tests/ regional_mom6/ | |
| else | |
| python -m pytest -v --doctest-modules tests/ regional_mom6/ | |
| fi | |
| - name: Test the example notebook | |
| run: | | |
| ln -s /data demos/PATH_TO_GLORYS_DATA | |
| ln -s /data demos/PATH_TO_GEBCO_FILE | |
| ln -s /build/FRE-NCtools/tools demos/PATH_TO_FRE_TOOLS | |
| ln -s /data demos/PATH_TO_YOUR_HORIZONTAL_GRID | |
| ln -s /data demos/PATH_TO_ERA5_DATA | |
| python -m pytest --nbval demos/machine-agnostic-demo.ipynb demos/BYO-domain.ipynb --nbval-current-env --cov=regional_mom6 --cov-report=xml tests/ | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| if: ${{ matrix.python-version == '3.10' }} | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| directory: ./coverage/reports/ | |
| env_vars: OS,PYTHON | |
| files: ./coverage.xml | |
| name: codecov-umbrella |