-
Notifications
You must be signed in to change notification settings - Fork 75
81 lines (71 loc) · 2.47 KB
/
tests-conda.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Conda Tests
# We don't want pushes (or PRs) to gh-pages to kick anything off
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
#
# Run all tests on Conda on both Windows and macOS
#
CondaTests:
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
os: [macOS, Windows]
steps:
# We check out only a limited depth and then pull tags to save time
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Setup conda caching
uses: actions/cache@v3
with:
path: ~/conda_pkgs_dir
key: conda-tests-${{ runner.os }}-${{ matrix.python-version}}-${{ hashFiles('ci/*') }}
restore-keys: |
conda-tests-${{ runner.os }}-${{ matrix.python-version}}
conda-tests-${{ runner.os }}
conda-tests-
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
channel-priority: strict
channels: conda-forge
show-channel-urls: true
# Needed for caching
use-only-tar-bz2: true
- name: Install dependencies
run: conda install --quiet --yes --file ci/test_requirements.txt --file ci/extra_requirements.txt --file ci/requirements.txt
- name: Install
# For some reason on Windows 3.7 building the wheel fails to properly include our extra
# stuff. Executing the egg_info beforehand for some reason fixes it. No idea why. We're
# deep in territory where googling for answers helps not at all.
run: |
python setup.py egg_info
python -m pip install --no-deps .
- name: Run tests
# By running coverage in "parallel" mode and "combining", we can clean up the path names
run: |
export TEST_DATA_DIR=$GITHUB_WORKSPACE/staticdata
python -m coverage run -p -m pytest tests
python -m coverage combine
python -m coverage report
python -m coverage xml
- name: Upload coverage
if: ${{ always() }}
uses: codecov/codecov-action@v3
with:
name: conda-${{ matrix.python-version }}-${{ runner.os }}