Skip to content

CI

CI #1209

Workflow file for this run

name: CI
on:
push:
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”
workflow_dispatch: # allows you to trigger manually
jobs:
skip-duplicate-jobs:
runs-on: ubuntu-latest
if: |
github.repository == 'CESM-ESPWG/ESP-Lab'
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5.3.1
with:
# For workflows which are triggered concurrently with the same
# contents, attempt to execute them exactly once.
concurrent_skipping: 'same_content_newer'
paths_ignore: '["**/doc/**"]'
build:
name: python-${{ matrix.python-version }}
needs: skip-duplicate-jobs
if: ${{ needs.skip-duplicate-jobs.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge,nodefaults
channel-priority: strict
activate-environment: esp-lab-dev
auto-update-conda: false
python-version: ${{ matrix.python-version }}
environment-file: ci/environment.yml
mamba-version: '*'
use-mamba: true
miniforge-variant: Mambaforge
- name: Install esp-lab
run: |
python -m pip install -e . --no-deps --force-reinstall
conda list
- name: Run Tests
run: |
python -m pytest
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v4.5.0
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false