[pre-commit.ci] pre-commit autoupdate #402
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/checkout@v3.0.2 | |
- 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/setup-miniconda@v2.1.1 | |
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/codecov-action@v3.1.1 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
env_vars: OS,PYTHON | |
name: codecov-umbrella | |
fail_ci_if_error: false |