-
Notifications
You must be signed in to change notification settings - Fork 115
91 lines (79 loc) · 2.67 KB
/
test.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
82
83
84
85
86
87
88
89
90
91
name: Test Python code
on:
pull_request:
branches:
- main
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: True
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.10", "3.11"]
channel-priority: [strict]
envfile: [".github/environment.yml"]
include:
- python-version: "3.12"
os: macos-latest
- python-version: "3.12"
os: windows-latest
- python-version: "3.12"
os: ubuntu-latest
channel-priority: flexible
- os: ubuntu-latest
python-version: "3.7"
envfile: ".github/environment-minimal.yml"
channel-priority: "flexible"
name: "Minimal dependencies"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Cache conda packages
uses: actions/cache@v4
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles( matrix.envfile ) }}
- name: Create conda environment
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
auto-activate-base: false
channel-priority: ${{ matrix.channel-priority }}
environment-file: ${{ matrix.envfile }}
# Disabling bz2 to get more recent dependencies.
# NOTE: this breaks cache support, so CI will be slower.
use-only-tar-bz2: False # IMPORTANT: This needs to be set for caching to work properly!
- name: Install package in development mode
shell: bash -l {0}
run: python -m pip install --upgrade-strategy=only-if-needed -e .[display,tests]
- name: Log installed packages for debugging
shell: bash -l {0}
run: |
conda info -a
conda list
- name: Show libraries in the system on which NumPy was built
shell: bash -l {0}
run: python -c "import numpy; numpy.show_config()"
- name: Show libraries in the system on which SciPy was built
shell: bash -l {0}
run: python -c "import scipy; scipy.show_config()"
- name: Run unit tests
shell: bash -l {0}
run: pytest
working-directory: tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
verbose: true