Bump actions #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
pull_request: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: 🔨 Build distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 🏗 Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- 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@v4 | |
with: | |
name: dist | |
path: dist | |
pre-commit: | |
name: 🧹 Pre-commit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 🏗 Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- 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@v4 | |
- name: 🏗 Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
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@v5 | |
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 |