-
Notifications
You must be signed in to change notification settings - Fork 31
97 lines (84 loc) · 2.37 KB
/
pythontest.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
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
92
93
94
95
96
97
name: Pytest and coveralls
on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- '**'
paths:
- 'qupulse/**y'
- 'qctoolkit/**'
- 'tests/**'
- 'setup.*'
- 'pyproject.toml'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
time-type: ["fractions", "gmpy2"]
env:
INSTALL_EXTRAS: tests,plotting,zurich-instruments,tektronix,tabor-instruments
steps:
- name: Add gmpy extra feature
if: ${{ matrix.time-type }} == 'gmpy2'
run: |
echo "INSTALL_EXTRAS=${{ env.INSTALL_EXTRAS }},Faster-fractions" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# supported since 2.3
cache: pip
cache-dependency-path: setup.cfg
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install coverage coveralls
- name: Install package
run: |
python -m pip install .[${{ env.INSTALL_EXTRAS }}]
- name: Test with pytest
run: |
coverage run -m pytest --junit-xml pytest.xml
- name: Upload coverage data to coveralls.io
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}-${{ matrix.time-type }}
COVERALLS_PARALLEL: true
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results ( ${{ matrix.python-version }}-${{ matrix.time-type }} )
path: |
pytest.xml
coveralls:
name: Indicate completion to coveralls.io
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Event File
path: ${{ github.event_path }}