🚀 5.1.0 #2037
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
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [ master, develop ] | |
pull_request: | |
branches: [ master, develop ] | |
jobs: | |
UI: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get yarn cache dir | |
id: yarnCache | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.yarnCache.outputs.dir }} | |
key: ${{ runner.os }}-build-cache-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
working-directory: ui | |
run: yarn install | |
- name: Lint | |
working-directory: ui | |
run: yarn lint | |
- name: Test | |
working-directory: ui | |
run: yarn test | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
continue-on-error: true | |
with: | |
github-token: ${{ secrets.github_token }} | |
flag-name: ui | |
parallel: true | |
- name: Build UI | |
working-directory: ui | |
run: yarn build | |
Python: | |
name: Python ${{ matrix.python }}, OctoPrint ${{ matrix.octoprint }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: [ "3.9", "3.10", "3.11", "3.12" ] | |
octoprint: [ "1.5", "1.6", "1.7", "1.8", "1.9", "1.10" ] | |
exclude: | |
# These versions are not compatible to each other: | |
- octoprint: 1.5 | |
python: 3.10 | |
- octoprint: 1.5 | |
python: 3.11 | |
- octoprint: 1.5 | |
python: 3.12 | |
- octoprint: 1.6 | |
python: 3.10 | |
- octoprint: 1.6 | |
python: 3.11 | |
- octoprint: 1.6 | |
python: 3.12 | |
- octoprint: 1.7 | |
python: 3.10 | |
- octoprint: 1.7 | |
python: 3.11 | |
- octoprint: 1.7 | |
python: 3.12 | |
- octoprint: 1.8 | |
python: 3.10 | |
- octoprint: 1.8 | |
python: 3.11 | |
- octoprint: 1.8 | |
python: 3.12 | |
- octoprint: 1.9 | |
python: 3.12 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Get pip cache dir | |
id: pipCache | |
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache pip modules | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pipCache.outputs.dir }} | |
key: ${{ runner.os }}-build-cache-pip-python-${{ matrix.python }}-octoprint-${{ matrix.octoprint}} | |
- name: Install OctoPrint | |
# see https://stackoverflow.com/questions/49854628/how-do-i-pip-install-the-latest-patch-number-of-a-package | |
run: pip install octoprint~=${{ matrix.octoprint }}.0 | |
- name: Install Wheel | |
# see https://community.octoprint.org/t/setuptools-error-while-installing-plugin-octoklipper-on-manual-op-installation/51387 | |
run: pip install wheel | |
- name: Install OctoRelay | |
run: pip install -e . | |
- name: Prepare testing environment | |
run: pip install coverage pylint mypy | |
- name: Test | |
working-directory: tests | |
run: python -m coverage run -m unittest test*.py | |
- name: Report the coverage | |
working-directory: tests | |
run: | | |
python -m coverage lcov --omit=test*,_version* | |
python -m coverage report --show-missing --omit=test*,_version* | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
continue-on-error: true | |
with: | |
github-token: ${{ secrets.github_token }} | |
flag-name: python-${{ matrix.python }}-octoprint-${{ matrix.octoprint }} | |
parallel: true | |
file: ./tests/coverage.lcov | |
- name: Types checking | |
run: mypy ./octoprint_octorelay | |
- name: Lint | |
run: pylint --rcfile=.pylintrc ./octoprint_octorelay ./tests/*.py | |
finish: | |
needs: [UI, Python] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
continue-on-error: true | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.github_token }} | |
parallel-finished: true |