Ref: API: Moving response shaping out of handlers #1578
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@v3 | |
with: | |
node-version: 18.x | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarnCache.outputs.dir }} | |
key: ${{ runner.os }}-build-cache-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
working-directory: ts | |
run: yarn install | |
- name: Lint | |
working-directory: ts | |
run: yarn lint | |
- name: Test | |
working-directory: ts | |
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 JS | |
working-directory: ts | |
run: yarn build | |
Python: | |
name: Python ${{ matrix.python }}, OctoPrint ${{ matrix.octoprint }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: [ "3.7", "3.8", "3.9", "3.10", "3.11" ] | |
octoprint: [ "1.5", "1.6", "1.7", "1.8", "1.9" ] | |
exclude: | |
# These versions are not compatible to each other: | |
- octoprint: 1.5 | |
python: 3.10 | |
- octoprint: 1.5 | |
python: 3.11 | |
- octoprint: 1.6 | |
python: 3.10 | |
- octoprint: 1.6 | |
python: 3.11 | |
- octoprint: 1.7 | |
python: 3.10 | |
- octoprint: 1.7 | |
python: 3.11 | |
- octoprint: 1.8 | |
python: 3.10 | |
- octoprint: 1.8 | |
python: 3.11 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
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@v3 | |
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 | |
if: matrix.octoprint != '1.9' | |
run: pip install wheel | |
- name: Install OctoRelay | |
run: pip install -e . | |
- name: Prepare testing environment | |
run: pip install coverage pylint snapshottest 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*,snap_* | |
- 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 | |
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 |