-
Notifications
You must be signed in to change notification settings - Fork 42
67 lines (57 loc) · 1.92 KB
/
tests_without_binary.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
66
67
name: Testing without binary
on:
push:
branches:
- master
pull_request:
env:
COVERAGE_FLAGS: "--cov=pennylane_lightning --cov-report=term-missing --cov-report=xml:./coverage.xml --no-flaky-report -p no:warnings --tb=native"
concurrency:
group: tests_without_binary-${{ github.ref }}
cancel-in-progress: true
jobs:
pythontests:
name: Python tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
pl_backend: ["lightning_qubit", "lightning_kokkos"]
steps:
- name: Checkout PennyLane-Lightning
uses: actions/checkout@v3
with:
path: main
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
- name: Get required Python packages
run: |
cd main
python -m pip install -r requirements-dev.txt
- name: Install the pennylane_lightning package
if: ${{ matrix.pl_backend == 'lightning_kokkos'}}
run: |
cd main
SKIP_COMPILATION=True PL_BACKEND="lightning_qubit" pip install -e . -vv
- name: Install backend device
env:
SKIP_COMPILATION: True
PL_BACKEND: ${{ matrix.pl_backend }}
run: |
cd main
python -m pip install -e . -vv
- name: Run PennyLane-Lightning unit tests
run: |
cd main/
DEVICENAME=`echo ${{ matrix.pl_backend }} | sed "s/_/./g"`
PL_DEVICE=${DEVICENAME} python -m pytest tests/ $COVERAGE_FLAGS
pl-device-test --device ${DEVICENAME} --skip-ops --shots=20000 $COVERAGE_FLAGS --cov-append
pl-device-test --device ${DEVICENAME} --shots=None --skip-ops $COVERAGE_FLAGS --cov-append
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./main/coverage.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}