-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (70 loc) · 2.44 KB
/
integration.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
name: Bundle Integration Tests
on:
# pushes to release branches
push:
branches:
- "main"
# all PRs, important to note that `pull_request_target` workflows
# will run in the context of the target branch of a PR since this
# is a public repo
pull_request_target:
workflow_dispatch:
inputs:
test_ref:
description: the ref (either sha or branch) to test against
default: 'main'
# explicitly turn off permissions for `GITHUB_TOKEN`
permissions: read-all
# will cancel previous workflows triggered by the same event and for the same ref for PRs or same SHA otherwise
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os: ["macos-12", "ubuntu-latest"]
python-version: ["3.8", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ${{ matrix.python-version }} Test
steps:
- name: Check out the repository (PR)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Check out the repository (workflow_dispatch)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{ inputs.test_ref }}
- name: Check out the repository (non-PR)
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Linux
if: matrix.os == 'ubuntu-latest'
run: |
./.github/scripts/worker_install_linux_deps.sh
- name: Set up Mac
if: matrix.os == 'macos-12'
run: |
./.github/scripts/worker_install_mac_deps.sh
- name: Python setup
run: |
python -m pip install --upgrade pip
python -m pip install tox cython
- name: Run Unit Tests
run: tox -e unit
- name: Run Integration Tests (long running)
# run integration tests even when unit tests fail
if: ${{ always() }}
run: tox -r -e integration