-
Notifications
You must be signed in to change notification settings - Fork 41
58 lines (54 loc) · 2 KB
/
python_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
name: Build Status
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
#python-version: [3.6, 3.7]
# disabled 3.7 because of 'AttributeError: 'str' object has no attribute 'decode''
python-version: [3.6]
steps:
- uses: actions/checkout@v1
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Setup headless display
run: |
sudo apt-get update
sudo apt-get install xvfb
sudo Xvfb :99 -screen 0 1024x768x24 </dev/null &
sleep 3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get install python3-pyqt5
pip install -r requirements.txt
pip install qutip # ensure all dependencies installed before qutip
pip install -e . # installs pycqed itself
pip install coverage
pip install pytest-cov
pip install codecov
pip install codacy-coverage
pip install pytest
pip install pytest-xvfb
- name: Lint with flake8
run: |
pip install flake8
# dont stop the build if there are Python syntax errors or undefined names
flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
py.test pycqed/tests --cov=pycqed --cov-report xml --cov-report html --cov-config=.coveragerc
# FIXME: codacy upload broken, 20211208
# - name: Upload code coverage report
# run: |
# python-codacy-coverage -r coverage.xml
# codecov
# env: # set secrets as environmental variables
# CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}