-
Notifications
You must be signed in to change notification settings - Fork 3
/
workflow-template-release-candidate.yml
85 lines (70 loc) · 2.5 KB
/
workflow-template-release-candidate.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Workflow template for testing plugins against PennyLane release candidate
name: {{ plugin }}-latest-rc
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
env:
PLUGIN_REPO: {{ gh_user }}/{{ plugin_repo }}
PLUGIN_BRANCH: {% if branch %}{{ branch }}{% else %}master{% endif %}
PLUGIN_PACKAGE: {{ plugin_package }}
PENNYLANE_BRANCH: master
{%- if token is defined %}
{{ token }}: {% raw %}${{ secrets.{% endraw %}{{ token }}{% raw %} }}{% endraw %}
{%- endif %}
{%- if additional_env_vars is defined %}
{{ additional_env_vars }}
{%- endif %}
jobs:
tests:
runs-on: {% if runs_on is defined %}{{ runs_on }}{% else %}ubuntu-latest{% endif %}
strategy:
fail-fast: false
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: {% raw %}${{ github.token }}{% endraw %}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
{%- if additional_setup is defined %}
{{ additional_setup | indent(6, True) }}
{%- endif %}
- name: Install requirements
run: |
pip install --upgrade pip
{%- for req in requirements %}
pip install --upgrade {{ req }}
{%- endfor %}
{%- if requirements_latest is defined %}
{%- for req in requirements_latest %}
pip install --upgrade {{ req }}
{%- endfor %}
{%- endif %}
pip install 'pytest<8.1.0'
pip install pytest-mock pytest-cov flaky pytest-benchmark
pip freeze
- name: Install PennyLane and Plugin
run: |
{% raw -%}
pip install git+https://github.com/PennyLaneAI/[email protected] \
git+https://github.com/${{ env.PLUGIN_REPO }}.git@${{ env.PLUGIN_BRANCH }}
{%- endraw %}
- uses: actions/checkout@v2
with:
repository: {% raw %}${{ env.PLUGIN_REPO }}{% endraw %}
path: plugin_repo
ref: {% raw %}${{ env.PLUGIN_BRANCH }}{% endraw %}
- name: Run PennyLane device integration tests
run: |
{%- for test in device_tests %}
pl-device-test {{ test }}
{%- endfor %}
- name: Run plugin tests
run: python -m pytest plugin_repo/{{ tests_loc }} --tb=short {%- for kwarg in test_kwargs %} {{ kwarg }} {%- endfor %}