Skip to content

CI

CI #332

Workflow file for this run

name: CI
on:
push:
pull_request:
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 == 'c-worthy-ocean/ocean-c-lab'
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
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@v3
- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge,nodefaults
channel-priority: strict
activate-environment: c_worthy
auto-update-conda: false
python-version: ${{ matrix.python-version }}
environment-file: ci/environment.yml
mamba-version: '*'
use-mamba: true
miniforge-variant: Mambaforge
- name: Install ocean-c-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/[email protected]
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false