-
Notifications
You must be signed in to change notification settings - Fork 37
64 lines (62 loc) · 1.84 KB
/
pytest.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
# Test strax on each PR
name: tests
# Trigger this code when a new release is published
on:
workflow_dispatch:
release:
types: [created]
pull_request:
branches:
- master
- stable
push:
branches:
- master
jobs:
update:
name: "${{ matrix.test }}_py${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
test: ['coveralls', 'pytest']
# Only run coverage on py3.8
exclude:
- python-version: 3.7
test: coveralls
- python-version: 3.9
test: coveralls
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2.3.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'extra_requirements/requirements-tests.txt'
- name: Install requirements
run: pip install -r extra_requirements/requirements-tests.txt
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.7.0
with:
mongodb-version: 4.2
# Perform coveralls (if coverage is set to True) or pytest
- name: Test package
if: matrix.test == 'pytest'
env:
TEST_MONGO_URI: 'mongodb://localhost:27017/'
run: |
pytest -v --durations 0
- name: Coveralls
if: matrix.test == 'coveralls'
env:
NUMBA_DISABLE_JIT: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST_MONGO_URI: 'mongodb://localhost:27017/'
run: |
coverage run --source=strax setup.py test -v
coveralls --service=github
- name: goodbye
run: echo goodbye