-
-
Notifications
You must be signed in to change notification settings - Fork 14
151 lines (144 loc) · 4.21 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
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
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@v3
with:
fetch-depth: 0
- name: 🏗 Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: 🏗 Install build dependencies
run: |
python -m pip install wheel --user
python -m pip install octoprint
- name: 🔨 Build source zip
run: |
python setup.py sdist --formats=zip
- name: 🚚 rename to sdist.zip
run: |
ls dist
mv dist/Marlin\ EEPROM\ editor-*.zip dist/sdist.zip
- name: ⬆ Upload build result
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
test-unit:
name: 🧪 Unit tests
strategy:
matrix:
python: ["3.7", "3.9", "3.11"]
octoprint: [">=1.5.0"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🏗 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: 🏗 Set up test dependencies
run: |
python -m pip install wheel --user
pip install octoprint${{ matrix.octoprint }} pytest
pip install -e .
- name: 🚀 Run test suite
run: |
pytest
lint-black:
name: 🧹 black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🏗 Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: 🏗 Set up dev dependencies
run: |
python -m pip install wheel --user
pip install octoprint[develop]
- name: 🚀 Run black
run: |
pre-commit run --hook-stage manual black --all-files --show-diff-on-failure
lint-prettier:
name: 🧹 prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🏗 Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: 🏗 Set up dev dependencies
run: |
python -m pip install wheel --user
pip install octoprint[develop]
- name: 🚀 Run prettier
run: |
pre-commit run --hook-stage manual prettier --all-files --show-diff-on-failure
lint-isort:
name: 🧹 isort
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 🏗 Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: 🏗 Set up dev dependencies
run: |
python -m pip install wheel --user
pip install octoprint[develop]
- name: 🚀 Run isort
run: |
pre-commit run --hook-stage manual isort --all-files --show-diff-on-failure
lint-flake8:
name: 🧹 Flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🏗 Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: 🏗 Set up OctoPrint dev dependencies
run: |
python -m pip install wheel --user
pip install octoprint[develop]
- name: 🚀 Run flake8
run: |
pre-commit run --hook-stage manual flake8 --all-files
test-install:
name: 🧪 Installation tests
needs: build
strategy:
matrix:
python: ["3.7", "3.9", "3.11"]
runs-on: ubuntu-latest
steps:
- name: 🏗 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: ⬇ Download build result
uses: actions/[email protected]
with:
name: dist
path: dist
- name: 🏗 Install dependencies
run: |
python -m pip install --upgrade wheel setuptools pip
python -m pip install octoprint
- name: 🧪 Test install of package
run: |
python -m pip install dist/sdist.zip