This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
137 lines (137 loc) · 4.34 KB
/
ci.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: CI
on:
pull_request:
push:
branches: [master]
workflow_dispatch:
inputs:
debug_enabled:
description: "Run the build with tmate debugging enabled"
required: false
jobs:
tox:
runs-on: ubuntu-latest
strategy:
matrix:
tox-env: [lint, type, docs, check-apidoc, check-packaging]
steps:
- name: Cancel previous workflows that are still running
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- name: Checkout latest commit
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history with version tags
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Set up pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ matrix.tox-env }}-${{ runner.os }}-${{ hashFiles('tox.ini') }}
- name: Set up environment
run: |
pip install --upgrade pip wheel setuptools
pip install tox
- name: Run tox ${{ matrix.tox-env }}
run: tox -vv -e ${{ matrix.tox-env }}
unit-tests-ubuntu:
runs-on: ${{ matrix.os }}
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.3.3
env:
discovery.type: single-node
xpack.security.enabled: false
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 9200:9200
env:
PIP_CACHE_DIR: .cache/pip
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
include:
- python-version: 3.8
tox-env: py38
- python-version: 3.9
tox-env: py39
- python-version: 3.10
tox-env: py310
steps:
- name: Cancel previous workflows that are still running
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- name: Checkout latest commit
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history with version tags
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up pip cache
uses: actions/cache@v2
with:
path: .cache/pip
key: ${{ matrix.tox-env }}-${{ matrix.os }}-${{ hashFiles('tox.ini') }}
- name: Set up environment
run: |
pip install --upgrade pip
pip install tox
- name: Set up tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
- name: Run unit tests
run: tox -vv -e ${{ matrix.tox-env }} -- --color=yes
unit-tests-macos:
runs-on: ${{ matrix.os }}
env:
PIP_CACHE_DIR: .cache/pip
strategy:
fail-fast: false
matrix:
os: [macos-latest]
python-version: ["3.10"]
include:
- python-version: 3.10
tox-env: py310
steps:
- name: Cancel previous workflows that are still running
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- name: Checkout latest commit
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history with version tags
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up pip cache
uses: actions/cache@v2
with:
path: .cache/pip
key: ${{ matrix.tox-env }}-${{ matrix.os }}-${{ hashFiles('tox.ini') }}
- name: Set up environment
run: |
pip install --upgrade pip
pip install tox
- name: Set up tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
- name: Install mysql
run: brew install mysql
- name: Run unit tests
run: tox -vv -e ${{ matrix.tox-env }} -- --color=yes