-
Notifications
You must be signed in to change notification settings - Fork 28
110 lines (90 loc) · 2.66 KB
/
tests.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
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Also, run each Monday At 07:00.
schedule:
- cron: '0 7 * * 1'
# Allow job to be triggered manually.
workflow_dispatch:
# Cancel in-progress jobs when pushing to the same branch.
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ] # , macos-latest, windows-latest ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
mosquitto-version: [ "2.0" ]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
name: Python ${{ matrix.python-version }}, Mosquitto ${{ matrix.mosquitto-version }}
steps:
- name: Acquire sources
uses: actions/checkout@v3
- name: Start Mosquitto
uses: namoshek/mosquitto-github-action@v1
with:
version: ${{ matrix.mosquitto-version }}
ports: '1883:1883 8883:8883'
# certificates: ${{ github.workspace }}/.ci/tls-certificates
config: ${{ github.workspace }}/.github/etc/mosquitto-no-auth.conf
# container-name: 'mqtt'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: |
setup.py
requirements-build.txt
requirements-cpython.txt
requirements-dev.txt
requirements-docs.txt
requirements-mpy.txt
requirements-release.txt
requirements-sbc.txt
requirements-terkin-agent.txt
requirements-test.txt
- name: Install program
run: |
make setup
make setup-cpython
- name: Run tests
run: |
make setup-tests
make test
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
docs:
runs-on: ubuntu-latest
name: Sphinx documentation
steps:
- name: Acquire sources
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: x64
cache: 'pip'
cache-dependency-path: |
setup.py
requirements-docs.txt
- name: Build documentation
run: |
make docs-html