-
Notifications
You must be signed in to change notification settings - Fork 274
298 lines (236 loc) · 8.34 KB
/
main.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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
name: main
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check:
# runs-on: ubuntu-20.04 # means github.com
runs-on: [self-hosted, linux, X64] # means matterhorn
steps:
- uses: actions/checkout@v3
# must be skipped on self-hosted build slaves (eg matterhorn)
#
# - name: Install OS package dependencies
# run: |
# sudo apt update
# sudo apt install libenchant-dev
# sudo apt install libbz2-dev
# sudo apt install libsnappy-dev
# sudo apt install libunwind-dev
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
architecture: 'x64'
- name: Install Python package dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run Flake8
run: tox -c tox.ini -e flake8
- name: Run Yapf
run: tox -c tox.ini -e yapf
- name: Run MyPy
run: tox -c tox.ini -e mypy
- name: Run Bandit
run: tox -c tox.ini -e bandit
analyze:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
docs:
# runs-on: ubuntu-20.04 # means github.com
runs-on: [self-hosted, linux, X64] # means matterhorn
steps:
- uses: actions/checkout@v3
# must be skipped on self-hosted build slaves (eg matterhorn)
#
# - name: Install OS package dependencies
# run: |
# sudo apt update
# sudo apt install libenchant-dev
# sudo apt install libbz2-dev
# sudo apt install libsnappy-dev
# sudo apt install libunwind-dev
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
architecture: 'x64'
- name: Install Python package dependencies
run: |
pip install -r requirements-dev.txt
pip install -U pip setuptools
- name: Install Crossbar.io packages
run: |
pip install -U --force-reinstall -r requirements-latest.txt
pip install .
- name: Run Sphinx
run: tox -c tox.ini -e sphinx
unit-test-amd64:
# runs-on: ubuntu-20.04 # means github.com
runs-on: [self-hosted, linux, X64] # means matterhorn
env:
CB_FULLTESTS: 1
# Test on specific CPython & PyPy versions
strategy:
matrix:
# https://github.com/actions/setup-python#specifying-a-pypy-version
python-version: ['3.11', 'pypy-3.9']
# https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
continue-on-error: false
steps:
# Checkout sources
- uses: actions/checkout@v3
# must be skipped on self-hosted build slaves (eg matterhorn)
#
# Install OS packages, as we install Python packages from source:
# libenchant-dev: needed for pyenchant, needed for sphinx-spellcheck
# libbz2-dev, libsnappy-dev: needed for compression
# libunwind-dev: needed for vmprof
# - name: Install OS package dependencies
# run: |
# sudo apt update
# sudo apt install build-essential libssl-dev libffi-dev libunwind-dev \
# libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \
# libsnappy-dev
# Use this Python
# https://github.com/actions/setup-python/blob/main/README.md
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python package dependencies
run: |
pip install -r requirements-dev.txt
pip install -U pip setuptools
- name: Install Crossbar.io packages
run: |
pip install -U --force-reinstall -r requirements-latest.txt
pip install .
- name: Display Crossbar.io version
run: |
crossbar version
- name: Run Python import tests
run: |
python ./test/test_imports.py
- name: Run unit tests (trial)
run: |
python -m twisted.trial crossbar
- name: Run unit tests (pytest)
run: |
pytest -sv crossbar
functional-test-amd64:
runs-on: [self-hosted, linux, X64] # means matterhorn
strategy:
matrix:
python-version: ['3.11']
continue-on-error: false
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python package dependencies
run: |
pip install -r requirements-dev.txt
pip install -U pip setuptools
- name: Install Crossbar.io packages
run: |
pip install -U --force-reinstall -r requirements-latest.txt
pip install .
- name: Display Crossbar.io version
run: |
crossbar version
- name: Run integration tests (Autobahn|Python Client)
run: |
./test/test_ab_examples.sh
- name: Run functional tests - cbtests
run: |
pytest -sv --no-install ./test/functests/cbtests
# FIXME
# - name: Run functional tests - cfctests
# run: |
# pytest -sv --no-install ./test/functests/cfctests
# - name: Run command line tests (Crossbar.io CLI) 0
# run: |
# ./test/test_cli_0.sh
# - name: Run command line tests (Crossbar.io CLI) 0
# run: |
# ./test/test_cli_1.sh
# - name: Run command line tests (Crossbar.io CLI) 0
# run: |
# ./test/test_cli_2.sh
# - name: Run command line tests (Crossbar.io CLI) 0
# run: |
# ./test/test_cli_3.sh
# FIXME: https://github.com/crossbario/crossbar/issues/1842
#
# test-arm64:
# env:
# CB_FULLTESTS: 1
# # https://github.blog/changelog/2019-12-03-github-actions-self-hosted-runners-on-arm-architectures/
# # https://medium.com/@nabil.servais/using-github-actions-to-test-your-go-code-on-arm64-ce581e646cb
# runs-on: [self-hosted, linux, ARM64]
# strategy:
# matrix:
# # https://github.com/actions/setup-python#specifying-a-pypy-version
# # https://downloads.python.org/pypy/versions.json
# python-version: ['3.x', 'pypy-3.7-nightly']
# # https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/
# # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
# continue-on-error: false
# steps:
# # Checkout sources
# - uses: actions/checkout@v3
# # Use this Python
# # https://github.com/marketplace/actions/setup-python
# # https://github.com/actions/setup-python/blob/main/README.md
# # https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python#specifying-a-python-version
# # https://github.com/actions/setup-python/issues/45
# # https://github.com/sqlalchemy/sqlalchemy/blob/master/.github/workflows/create-wheels.yaml
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python-version }}
# architecture: aarch64
# - name: Install Python package dependencies
# run: |
# python -V
# python -m ensurepip
# python -m pip install -r requirements-dev.txt
# - name: Install Crossbar.io package dependencies & Crossbar.io
# run: |
# python -m pip install -r requirements-latest.txt
# python -m pip install .
# - name: Display Crossbar.io version
# run: |
# python -c "from autobahn import xbr; print(xbr.HAS_XBR)"
# python -c "import crossbar; print(crossbar.__version__)"
# - name: Run unit tests (Twisted Trial)
# run: |
# python -m twisted.trial crossbar
# - name: Run integration tests (Autobahn|Python Client)
# run: |
# ./test/test_ab_examples.sh