-
-
Notifications
You must be signed in to change notification settings - Fork 27
92 lines (87 loc) · 2.47 KB
/
test.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
# Run unit tests against Python 2.7, 3.6+
# Based on OctoPrint's CI build file https://github.com/OctoPrint/OctoPrint/blob/master/.github/workflows/build.yml by @foosel
name: Test
on:
push:
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published, prereleased]
jobs:
build:
name: 🔨 Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 🏗 Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: 🏗 Install build dependencies
run: |
python -m pip install wheel --user
python -m pip install octoprint[develop]
- name: 🔨 Build a binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel
- name: ⬆ Upload build result
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
test-unit:
name: 🧪 Unit tests
strategy:
matrix:
python: ["2.7", "3.7", "3.8", "3.9"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🏗 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: 🏗 Set up test dependencies
run: |
pip install octoprint[develop] pytest
pip install -e .
- name: 🚀 Run test suite
run: |
pytest
test-flake8:
name: 🧪 Flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🏗 Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: 🏗 Set up test dependencies
run: |
pip install octoprint[develop] flake8
pip install -e .
- name: 🚀 Run test suite
run: |
flake8 octoprint_ws281x_led_status tests setup.py
test-install:
name: 🧪 Installation tests
needs: build
strategy:
matrix:
python: ["2.7", "3.7", "3.8", "3.9"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🏗 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: 🚀 Install OctoPrint
run: |
pip install octoprint
- name: 🚀 Test install of plugin
run: |
pip install .