Skip to content

CI

CI #855

Workflow file for this run

name: CI
on:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”
workflow_dispatch: # allows you to trigger manually
jobs:
build:
name: Build (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set environment variables
run: |
if [[ ${{ matrix.os }} == windows* ]] ;
then
echo "CONDA_ENV_FILE=ci/environment-windows.yml" >> $GITHUB_ENV
else
echo "CONDA_ENV_FILE=ci/environment.yml" >> $GITHUB_ENV
fi
echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Set up conda environment with micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: ci/environment.yml
environment-name: dev-feisty
extra-specs: python=${{ matrix.python-version }}
- name: Use old versions of packages where conda is out of sync with version support
run: |
if [[ ${{ matrix.python-version }} == 3.7 ]] ;
then
echo "Need to use older versions of zipp and zarr"
micromamba install zarr=2.14.2 zipp=3.15.0
else
echo "Not modifying conda environment"
fi
- name: Show conda environment
shell: bash -l {0}
run: |
conda list
- name: Run Tests
shell: bash -l {0}
run: |
pytest --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
env_vars: RUNNER_OS,PYTHON_VERSION
name: codecov-umbrella
fail_ci_if_error: false
build-docs:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os: [ubuntu-latest]
# python-version: [3.8]
steps:
- uses: actions/checkout@v2
# Install dependencies
- name: Set up conda environment with micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: ci/environment.yml
environment-name: dev-feisty
extra-specs: python=${{ matrix.python-version }}
- name: Show conda environment
shell: bash -l {0}
run: |
conda list
# Build the book
- name: Build the book
run: |
jupyter-book build docs/ --all