Adding nutrients components #14 #35
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: Advanced tests | |
on: | |
pull_request: | |
types: [ready_for_review, opened] | |
branches: [main] | |
jobs: | |
run-basic-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@v2 | |
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: "*" | |
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 test suite | |
run: | | |
(cd ./tests && python run_all_tests.py) |