Skip to content

Build and test climlab #8

Build and test climlab

Build and test climlab #8

name: Build and test climlab
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.8', '3.9', '3.10', '3.11']
os: [Ubuntu, macOS, Windows]
include:
- os: Ubuntu
environment-file: environment.yml
shell: bash -l {0}
- os: macOS
environment-file: environment.yml
shell: bash -l {0}
- os: Windows
environment-file: environment.yml
shell: powershell
steps:
- uses: actions/checkout@v3
- name: Setup Python environment with Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}
activate-environment: test_env
channel-priority: strict
environment-file: ${{ matrix.environment-file }}
use-mamba: true
- name: Build and install climlab
run: |
python -m pip install --no-deps --editable .
- name: Import climlab
run: |
python -c "import climlab"
- name: Run tests
run: |
pytest -v --pyargs climlab.tests
# when we're ready to use codecov again
# run: |
# pytest -v --pyargs climlab.tests --cov=climlab --cov-config .coveragerc --cov-report term-missing -v
# codecov