Skip to content

Adding nutrients components #14 #43

Adding nutrients components #14

Adding nutrients components #14 #43

name: Advanced tests
on:
pull_request:
types: [ready_for_review, opened]
branches: [main]
jobs:
run-advanced-tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
fail-fast: false
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
# check out PR HEAD commit
- name: check out PR HEAD commit
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# set up a conda environment
- name: set up miniconda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: testing-env
python-version: ${{ matrix.python-version }}
auto-update-conda: true
mamba-version: "*"
miniconda-version: "latest"
channels: conda-forge
channel-priority: true
# install dependencies on conda environment
- name: install package dependencies
run: |
mamba install udunits2=2.2.25
mamba install --file=requirements.txt
mamba install --file=requirements-tests.txt
# build dummy components required for tests
- name: make gfortran available (macos only)
if: matrix.os == 'macos-latest'
run: |
sudo ln -s /usr/local/bin/gfortran-10 /usr/local/bin/gfortran
sudo mkdir /usr/local/gfortran
sudo ln -s /usr/local/Cellar/gcc@10/*/lib/gcc/10 /usr/local/gfortran/lib
- name: build dummy C and Fortran components
run: |
(cd ./tests/tests/components && make)
# install latest cf-python package
- name: install package
run: |
pip install https://github.com/NCAS-CMS/cf-python/archive/main.zip
# install package
- name: install package
run: |
pip install -e .
# run tests
- name: run advanced tests 1 (SameTimeSameSpace)
run: |
(cd ./tests && python run_stss_tests.py)
# run tests
- name: run advanced tests 2 (SameTimeDiffSpace)
run: |
(cd ./tests && python run_stds_tests.py)
# run tests
- name: run advanced tests 3 (DiffTimeSameSpace)
run: |
(cd ./tests && python run_dtss_tests.py)
# run tests
- name: run advanced tests 4 (DiffTimeDiffSpace)
run: |
(cd ./tests && python run_dtds_tests.py)