Skip to content

Build and test

Build and test #44

name: Build and test
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '35 4 * * TUE' # Tuesday at 04:35 UTC”
jobs:
build-and-test:
name: ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: ${{ matrix.shell }}
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [Ubuntu, macOS, Windows]
include:
- os: Ubuntu
environment-file: ci/requirements-linux.yml
shell: bash -l {0}
- os: macOS
environment-file: ci/requirements-macos.yml
shell: bash -l {0}
- os: Windows
environment-file: ci/requirements-windows.yml
shell: powershell
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
activate-environment: convect_build_env
channel-priority: strict
environment-file: ${{ matrix.environment-file }}
- name: Setup Fortran compiler for Windows
if: ${{ matrix.os == 'Windows' }}
run: |
echo "[build]`ncompiler=mingw32" | Out-File -Encoding ASCII ~/pydistutils.cfg
- name: Build and install climlab_rrtmg
run: |
python -m pip install --no-deps --editable .
- name: Import climlab_rrtmg
run: |
python -c "import climlab_emanuel_convection"
python -c "from climlab_emanuel_convection import emanuel_convection"
- name: Run tests
run: |
pytest -v --pyargs climlab_emanuel_convection