Skip to content

Build and test

Build and test #158

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.9', '3.10', '3.11']
os: [Ubuntu, macOS]
include:
- os: Ubuntu
shell: bash -l {0}
- os: macOS
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
activate-environment: rrtmg_build_env
channel-priority: strict
environment-file: ci/requirements.yml
- name: Build and install climlab_rrtmg
run: |
python -m pip install --no-deps --editable .
- name: Import climlab_rrtmg
run: |
python -c "import climlab_rrtmg"
python -c "from climlab_rrtmg import rrtmg_lw, rrtmg_sw"
- name: Run tests
run: |
pytest -v --pyargs climlab_rrtmg.tests