-
Notifications
You must be signed in to change notification settings - Fork 25
138 lines (133 loc) · 4.33 KB
/
CI.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# 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