⬆️ Quick upgrade to actions #194
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: 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@v4 | |
with: | |
fetch-depth: 0 | |
- name: 🏗 Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- 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@v4 | |
- name: 🏗 Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
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 | |
pre-commit: | |
name: 🧹 pre-commit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 🏗 Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: 🏗 Set up dev dependencies | |
run: | | |
python -m pip install wheel --user | |
pip install octoprint[develop] | |
- name: 🚀 Run pre-commit | |
run: | | |
pre-commit run --all-files --show-diff-on-failure | |
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@v5 | |
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 |