-
Notifications
You must be signed in to change notification settings - Fork 25
64 lines (56 loc) · 1.86 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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