Removing Field.to_write and FieldSet.to_write methods #749
Workflow file for this run
This file contains 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: ci | |
on: | |
push: | |
branches: | |
- "main" | |
- "test-me/*" | |
pull_request: | |
schedule: | |
- cron: "0 7 * * 1" # Run every Monday at 7:00 UTC | |
concurrency: | |
group: branch-${{ github.head_ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -el {0} | |
jobs: | |
unit-test: | |
name: "py${{ matrix.python-version }} | ${{ matrix.os }} | unit tests" | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos, ubuntu, windows] | |
python-version: ["3.13"] | |
include: | |
- os: ubuntu | |
python-version: "3.10" | |
- os: ubuntu | |
python-version: "3.11" | |
- os: ubuntu | |
python-version: "3.12" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Conda and parcels | |
uses: ./.github/actions/install-parcels | |
with: | |
environment-file: environment.yml | |
python-version: ${{ matrix.python-version }} | |
- name: Unit test | |
run: | | |
coverage run -m pytest -v -s --html=${{ matrix.os }}_${{ matrix.python-version }}_unit_test_report.html --self-contained-html tests | |
coverage xml | |
- name: Codecov | |
uses: codecov/codecov-action@v5.3.1 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
if: matrix.python-version == '3.13' | |
with: | |
flags: unit-tests | |
- name: Upload test results | |
if: ${{ always() }} # Always run this step, even if tests fail | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Unittest report ${{ matrix.os }}-${{ matrix.python-version }} | |
path: ${{ matrix.os }}_${{ matrix.python-version }}_unit_test_report.html | |
integration-test: | |
name: "py${{ matrix.python-version }} | ${{ matrix.os }} | integration tests" | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos, ubuntu, windows] | |
python-version: ["3.13"] | |
include: | |
- os: ubuntu | |
python-version: "3.10" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Conda and parcels | |
uses: ./.github/actions/install-parcels | |
with: | |
environment-file: environment.yml | |
- name: Integration test | |
# TODO v4: Re-enable `tutorial_periodic_boundaries`, `tutorial_timevaryingdepthdimensions` and `tutorial_croco_3D` notebooks | |
run: | | |
coverage run -m pytest -v -s --nbval-lax -k "not documentation and not tutorial_periodic_boundaries and not tutorial_timevaryingdepthdimensions and not tutorial_croco_3D" --html="${{ matrix.os }}_${{ matrix.python-version }}_integration_test_report.html" --self-contained-html docs/examples | |
coverage xml | |
- name: Codecov | |
uses: codecov/codecov-action@v5.3.1 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
flags: integration-tests | |
- name: Upload test results | |
if: ${{ always() }} # Always run this step, even if tests fail | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Integration test report ${{ matrix.os }}-${{ matrix.python-version }} | |
path: ${{ matrix.os }}_${{ matrix.python-version }}_integration_test_report.html | |
merge-test-artifacts: | |
runs-on: ubuntu-latest | |
needs: | |
- unit-test | |
- integration-test | |
- typechecking | |
steps: | |
- name: Merge Artifacts | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: Testing reports | |
pattern: "* report *" | |
typechecking: | |
name: mypy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Conda and parcels | |
uses: ./.github/actions/install-parcels | |
with: | |
environment-file: environment.yml | |
- run: conda install lxml # dep for report generation | |
- name: Typechecking | |
run: | | |
mypy --install-types --non-interactive parcels --html-report mypy-report | |
- name: Upload test results | |
if: ${{ always() }} # Upload even on mypy error | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Mypy report | |
path: mypy-report |