-
Notifications
You must be signed in to change notification settings - Fork 6
65 lines (53 loc) · 1.84 KB
/
testing.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
name: Unit Tests
on:
push:
pull_request:
jobs:
build:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
host-os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false
runs-on: ${{ matrix.host-os }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: testenv
allow-softlinks: true
auto-activate-base: false
auto-update-conda: true
channel-priority: flexible
channels: conda-forge
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
show-channel-urls: true
use-only-tar-bz2: false
- name: Install the package
run: |
set -vxeuo pipefail
# These packages are installed in the base environment but may be older
# versions. Explicitly upgrade them because they often create
# installation problems if out of date.
python3 -m pip install --upgrade pip setuptools wheel numpy
# Versioneer uses the most recent git tag to generate __version__,
# which appears in the published documentation.
git fetch --tags
python3 -m pip install .
python3 -m pip list
- name: Install test requirements
run: |
set -vxeuo pipefail
python3 -m pip install -r requirements-dev.txt
python3 -m pip list
- name: Test with pytest
run: |
set -vxeuo pipefail
coverage run -m pytest -v
coverage report