-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (95 loc) · 2.67 KB
/
build.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
name: Build
on:
push:
pull_request:
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: 🔨 Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 🏗 Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: 🏗 Install build dependencies
run: |
pip install wheel --user
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
pre-commit:
name: 🧹 Pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🏗 Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: 🏗 Set up dev dependencies
run: |
pip install octoprint[develop]
pip install -e .[develop]
- name: 🚀 Run pre-commit
run: |
pre-commit run --all-files --show-diff-on-failure
test-unit:
name: 🧪 Unit tests
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
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: |
pip install octoprint[develop]
pip install -e .[develop]
- name: 🚀 Run test suite
run: |
pytest
test-install:
name: 🧪 Installation tests
needs: build
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
installable: ["wheel", "sdist"]
runs-on: ubuntu-latest
steps:
- name: ⬇ Download build result
uses: actions/download-artifact@v4.1.7
with:
name: dist
path: dist
- name: 🏗 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: 🏗 Install OctoPrint
run: |
pip install OctoPrint
- name: 🚀 Install wheel
if: matrix.installable == 'wheel'
run: |
pip install dist/Prusa*ETA*Override*-py2.py3-none-any.whl
- name: 🚀 Install source tarball
if: matrix.installable == 'sdist'
run: |
pip install dist/Prusa*ETA*Override*-*.tar.gz