Skip to content

WIP: Dynamic rechunking option for StoreToZarr #1291

WIP: Dynamic rechunking option for StoreToZarr

WIP: Dynamic rechunking option for StoreToZarr #1291

Workflow file for this run

name: Tests
on:
push:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
env:
PYTEST_ADDOPTS: "--color=yes"
# This our primary testing workflow.
#
# It also serves as an example for how to reference the separate prepare-env workflow.
# This workflow does not even attempt to build environments. It dispatches that resposibility
# to the prepare-env workflow and then loads the environments which that workflow has cached.
#
# Note that all of the steps listed under the comment ``# generic steps to load env from cache``
# are required to load the environment. They include:
# - Generating the cache key
# - Actually loading the environment using the key
# - Adding the path ``/usr/share/miniconda3/envs/pangeo-forge-recipes/bin`` to $PATH
jobs:
prepare-env:
uses: ./.github/workflows/prepare-env.yaml
run-tests:
needs: prepare-env
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
dependencies: ["releases-only", "upstream-dev"]
steps:
- uses: actions/checkout@v2
# generic steps to load env from cache
- name: 🎯 Set cache number
id: cache-number
# cache will last 3 days by default
run: echo CACHE_NUMBER=`expr $(date +'%j') / 3` >> $GITHUB_ENV
- name: 🎯 Set environment file
id: env-file
run: echo "env_file=ci/py${{ matrix.python-version }}.yml" >> $GITHUB_ENV
- uses: actions/cache@v2
name: πŸ—ƒ Loaded Cached environment
with:
path: /usr/share/miniconda3/envs/pangeo-forge-recipes
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles( env.env_file ) }}-${{ matrix.dependencies }}-${{ env.CACHE_NUMBER }}
id: conda-cache
- name: 🀿 Bail out if no cache hit
if: steps.conda-cache.outputs.cache-hit != 'true'
run: false
- name: 🎯 Set path to include conda python
run: echo "/usr/share/miniconda3/envs/pangeo-forge-recipes/bin" >> $GITHUB_PATH
# custom testing steps unique to this workflow
- name: 🌈 Install pangeo-forge-recipes package
shell: bash -l {0}
run: |
python -m pip install --no-deps -e .
- name: πŸ„β€β™‚οΈ Run Tests
shell: bash -l {0}
run: |
py.test tests -v \
--cov=pangeo_forge_recipes --cov-config .coveragerc \
--cov-report term-missing \
--cov-report xml \
--durations=10 --durations-min=1.0
- name: 🚦 Run Codecov
uses: codecov/codecov-action@v2.0.2
with:
file: ./coverage.xml
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false