Skip to content

merge to latest main #48

merge to latest main

merge to latest main #48

Workflow file for this run

name: pytest
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install NetCDF
run: |
sudo apt-get update
sudo apt-get install -y build-essential libnetcdf-dev libnetcdff-dev libudunits2-dev \
libjson-c-dev uuid-dev
- name: Install ESMF
uses: esmf-org/install-esmf-action@v1
env:
ESMF_NETCDF: nc-config
ESMF_INSTALL_PREFIX: $HOME/ESMF
with:
version: latest
esmpy: true
cache: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Cache CMOR build
uses: actions/cache@v4
with:
path: |
/home/runner/cmor
/home/runner/.cache/pip
key: cmor-${{ runner.os }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('**/cmor_version.txt') }}
restore-keys: |
cmor-${{ runner.os }}-
- name: build and install cmor
run: |
if [ ! -d "$HOME/cmor" ]; then
git clone https://github.com/PCMDI/cmor.git $HOME/cmor3-source
cd $HOME/cmor3-source
./configure --prefix=$HOME/cmor --with-netcdf=/usr/local --with-udunits2=/usr/local
make
make install
pip install .
fi
- name: Run pytest
env:
PYTHONPATH: ${{ github.workspace }}
ESMFMKFILE: ${{ env.ESMFMKFILE }}
LD_LIBRARY_PATH: ${{ env.ESMF_INSTALL_PREFIX }}/lib:${{ env.LD_LIBRARY_PATH }}
run: |
#pip uninstall -y cmip7-prep || true
#pip install .
pytest -q --doctest-modules