❤️ Update Sponsors #775
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@v2 | |
with: | |
fetch-depth: 0 | |
- name: 🏗 Set up Python 3.9 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
- name: 🏗 Install backend build dependencies | |
run: | | |
python -m pip install wheel --user | |
python -m pip install octoprint[develop] | |
- uses: actions/checkout@v2 | |
- name: 🏗 Setup Node 14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: 🏗 Install frontend build dependencies | |
run: | | |
npm install -g npm@7 | |
npm install | |
- name: 🔨 Build frontend code in release mode | |
run: | | |
npm run release | |
- 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@v2 | |
- name: 🏗 Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: 🏗 Set up dependencies | |
run: | | |
pip install octoprint[develop] | |
pip install . | |
- name: 🚀 Run pre-commit | |
run: | | |
pre-commit run --all-files --show-diff-on-failure | |
test-node: | |
name: 🧪 Frontend builds | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: 🏗 Setup Node 14 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: 🏗 Install build dependencies | |
run: | | |
npm install -g npm@7 | |
npm install | |
- name: 🔨 Build frontend code in release mode | |
run: | | |
npm run release | |
test-install: | |
name: 🧪 Installation tests | |
needs: build | |
strategy: | |
matrix: | |
python: ["3.7", "3.8", "3.9"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: 🏗 Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: 🚀 Install OctoPrint | |
run: | | |
pip install octoprint | |
- name: 🚀 Test install of plugin | |
run: | | |
pip install . |