-
-
Notifications
You must be signed in to change notification settings - Fork 21
56 lines (53 loc) · 1.73 KB
/
build-vwsfriend-python.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
name: Build Python Package
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
paths:
- .github/workflows/build-vwsfriend-python.yml
- 'vwsfriend/**.py'
- 'vwsfriend/**requirements.txt'
pull_request:
paths:
- .github/workflows/build-vwsfriend-python.yml
- 'vwsfriend/**.py'
- 'vwsfriend/**requirements.txt'
jobs:
build-python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
with-mqtt: [true, false]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
working-directory: vwsfriend
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f setup_requirements.txt ]; then pip install -r setup_requirements.txt; fi
if [ -f test_requirements.txt ]; then pip install -r test_requirements.txt; fi
- name: Install mqtt dependencies
working-directory: vwsfriend
if: matrix.with-mqtt == 'true'
run: |
if [ -f mqtt_extra_requirements.txt ]; then pip install -r mqtt_extra_requirements.txt; fi
- name: Lint
working-directory: vwsfriend
run: |
make lint
- name: Test
working-directory: vwsfriend
run: |
make test
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: vwsfriend/coverage_html_report/**