Build and test climlab #310
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: 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@v4 | |
- name: Setup Python environment with Mambaforge | |
uses: conda-incubator/setup-miniconda@v3 | |
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 |