-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (114 loc) · 3.15 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Tests
on:
push:
branches:
- master
pull_request:
jobs:
lint:
name: Static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.3.2"
- name: Install tox
run: pip install tox
- name: run tox lint and type
run: tox -e lint,type
unit-test:
name: Unit testing
needs: lint
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-13 # runs x64
- macos-14 # runs arm64
- windows-latest
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
runs-on: ${{ matrix.os }}
env:
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.3.2"
- name: Install tox
run: pip install tox
- name: run tox test
run: tox -e test
e2e-test:
name: End to End testing
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
backend-name:
- "Stubbed"
- "QX emulator"
env:
E2E_USERNAME: ${{ secrets.E2E_USERNAME }}
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.3.2"
- name: Install packages
run: poetry install
- name: Run e2e test
run: poetry run python tests/e2e_test.py "${{ matrix.backend-name }}"
complete:
# see https://github.community/t/status-check-for-a-matrix-jobs/127354/7
name: Report status
needs: [lint, unit-test, e2e-test]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check all job status
# see https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
# see https://stackoverflow.com/a/67532120/4907315
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}
run: exit 1
auto-merge-dependabot:
name: Auto merge dependabot PR
needs: complete
if: ${{ (github.event_name == 'pull_request') && (github.actor == 'dependabot[bot]') }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Squash and Merge PR from dependabot
uses: fastify/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
merge-method: squash