-
Notifications
You must be signed in to change notification settings - Fork 191
71 lines (60 loc) · 2.03 KB
/
tests.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
name: Tests
on:
push:
branches:
- master
pull_request:
env:
COVERALLS_PARALLEL: true
PURE: 1
BATCHED: 0
LOGGING: info
jobs:
core-tests:
runs-on: ubuntu-latest
env:
SYMPY_USE_CACHE: "no"
OPTIONS: ${{ matrix.options }}
BATCHED: ${{ matrix.batched }}
TF_DEPENDENCIES: "tensorflow|tensorboard"
strategy:
matrix:
include:
- {BATCHED: 0, OPTIONS: "frontend or apps or api or gaussian"}
- {BATCHED: 0, OPTIONS: "fock"}
- {BATCHED: 0, OPTIONS: "tf"}
- {BATCHED: 1, OPTIONS: "tf and pure"}
- {BATCHED: 1, OPTIONS: "tf and mixed"}
- {BATCHED: 0, OPTIONS: "bosonic"}
- {BATCHED: 0, OPTIONS: "not tf"}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
[ "$OPTIONS" = "not tf" ] && gawk -i inplace '!/('$TF_DEPENDENCIES')/' requirements-ci.txt
python3 -m pip install --upgrade pip
pip install -r requirements-ci.txt
pip install wheel codecov pytest pytest-cov pytest-randomly pytest-mock pytest-logger --upgrade
- name: Install Strawberry Fields
run: |
pip install -r requirements-ci.txt
python3 setup.py bdist_wheel
pip install dist/StrawberryFields*.whl
- name: Run tests
run: python3 -m pytest tests --cov=strawberryfields --cov-report=term-missing --cov-report=xml -p no:warnings --randomly-seed=42 --tb=native -m "$OPTIONS"
- name: Adjust coverage file for Codecov
run: bash <(sed -i 's/filename=\"/filename=\"strawberryfields\//g' coverage.xml)
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml