Skip to content

❤️ Update Sponsors #192

❤️ Update Sponsors

❤️ Update Sponsors #192

Workflow file for this run

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/download-artifact@v3
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