[pre-commit.ci] pre-commit autoupdate #413
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: CI | |
on: | |
push: | |
branches: "*" | |
pull_request: | |
branches: main | |
jobs: | |
test: | |
name: ${{ matrix.CONDA_ENV }}-test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
CONDA_ENV: ["3.8", "3.9", "3.10", "upstream"] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Cache Conda Packages | |
uses: actions/cache@v3 | |
env: | |
# Increase this value to reset cache if etc/example-environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: conda-${{ env.CACHE_NUMBER }}-${{hashFiles(format('ci/environment-{0}.yml',matrix.CONDA_ENV)) }} | |
- name: Cache Pip Packages (upstream environment) | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('ci/environment-upstream.yml') }} | |
- name: Setup Miniconda (Mambaforge) | |
uses: conda-incubator/[email protected] | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
use-mamba: true | |
activate-environment: intake-stac | |
environment-file: ci/environment-${{ matrix.CONDA_ENV }}.yml | |
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | |
- name: Development Install Intake-STAC | |
shell: bash -l {0} | |
run: | | |
python -m pip install --no-deps -e . --no-build-isolation | |
conda list | |
- name: Run Tests | |
shell: bash -l {0} | |
run: | | |
python -m pytest --cov=./ --cov-report=xml --verbose | |
- 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 |