-
-
Notifications
You must be signed in to change notification settings - Fork 14
208 lines (174 loc) · 6.34 KB
/
test.yml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Tests
on:
push:
branches: [1.x, 2.x, 2.*.x, 3.x]
paths:
- "**.py"
- skins/**
- bin/**
- test/**
- package.json
- yarn.lock
- playwright.config.ts
pull_request:
branches: [1.x, 2.x, 2.*.x, 3.x]
paths:
- "**.py"
- skins/**
- bin/**
- test/**
- package.json
- yarn.lock
- playwright.config.ts
jobs:
shunit2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "14"
cache: "yarn"
- name: Set timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Berlin"
- name: Install yarn and dependecies
run: yarn install
- name: Set custom run basePath
env:
CUSTOM_BASE_PATH: "${{ github.workspace }}/test/e2e-tests/artifacts-custom-weewx-html/public_html/"
run: |
echo "$CUSTOM_BASE_PATH"
sed -i -z "s|base_path = \/home\/dba\/dev\/weewx-wdc\/test\/e2e-tests\/artifacts-custom-weewx-html\/public_html/|base_path = \"${CUSTOM_BASE_PATH}\"|g" test/test_install_report/src/skin-custom.conf
sed -i -z "s|cloudbase = \/home\/dba\/dev\/weewx-wdc\/test\/e2e-tests\/artifacts-custom-weewx-html\/public_html\/dwd\/icons\/8.png|cloudbase = \"${CUSTOM_BASE_PATH}dwd\/icons\/8.png\"|g" test/test_install_report/src/skin-custom.conf
echo $(cat test/test_install_report/src/skin-custom.conf)
- name: Set OWM API key
env:
OWM_KEY: ${{ secrets.OWM }}
run: sed -i -z -e "s|SECRET_OWM|${OWM_KEY}|g" test/test_install_report/src/start-forecast.sh
- name: Run shunit2 tests
run: ./test/run_tests.sh
- name: Upload log artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: test_install_report_artifacts
path: test/test_install_report/artifacts/
- name: Upload alternative html
uses: actions/upload-artifact@v3
with:
name: artifacts-alternative-weewx-html
path: test/test_install_report/artifacts-alternative-weewx-html/
- name: Upload classic html
uses: actions/upload-artifact@v3
with:
name: artifacts-classic-weewx-html
path: test/test_install_report/artifacts-classic-weewx-html/
- name: Upload forecast html
uses: actions/upload-artifact@v3
with:
name: artifacts-forecast-weewx-html
path: test/test_install_report/artifacts-forecast-weewx-html/
- name: Upload custom html
uses: actions/upload-artifact@v3
with:
name: artifacts-custom-weewx-html
path: test/test_install_report/artifacts-custom-weewx-html/
- name: Upload weewx-DWD html
uses: actions/upload-artifact@v3
with:
name: artifacts-dwd-weewx-html
path: test/test_install_report/artifacts-dwd-weewx-html/
- name: Upload custom binding html
uses: actions/upload-artifact@v3
with:
name: artifacts-custom-binding-weewx-html
path: test/test_install_report/artifacts-custom-binding-weewx-html/
- name: Upload mqtt html
uses: actions/upload-artifact@v3
with:
name: artifacts-mqtt-weewx-html
path: test/test_install_report/artifacts-mqtt-weewx-html/
- name: Upload sensor status html
uses: actions/upload-artifact@v3
with:
name: artifacts-sensor-status-weewx-html
path: test/test_install_report/artifacts-sensor-status-weewx-html/
- name: Upload cmon html
uses: actions/upload-artifact@v3
with:
name: artifacts-cmon-weewx-html
path: test/test_install_report/artifacts-cmon-weewx-html/
playwright:
needs: shunit2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: 🔨 Setup node
uses: actions/setup-node@v3
with:
node-version: "14"
cache: "yarn"
- name: Set timezone
uses: szenius/[email protected]
with:
timezoneLinux: "Europe/Berlin"
- name: 🔨 install yarn and dependecies
run: yarn install
- name: install playwright deps
run: yarn playwright install --with-deps
- name: Download alternative html
uses: actions/download-artifact@v3
with:
name: artifacts-alternative-weewx-html
path: test/e2e-tests/artifacts-alternative-weewx-html
- name: Download classic html
uses: actions/download-artifact@v3
with:
name: artifacts-classic-weewx-html
path: test/e2e-tests/artifacts-classic-weewx-html
- name: Download forecast html
uses: actions/download-artifact@v3
with:
name: artifacts-forecast-weewx-html
path: test/e2e-tests/artifacts-forecast-weewx-html
- name: Download custom html
uses: actions/download-artifact@v3
with:
name: artifacts-custom-weewx-html
path: test/e2e-tests/artifacts-custom-weewx-html
- name: Download weewx-dwd html
uses: actions/download-artifact@v3
with:
name: artifacts-dwd-weewx-html
path: test/e2e-tests/artifacts-dwd-weewx-html
- name: Download custom binding html
uses: actions/download-artifact@v3
with:
name: artifacts-custom-binding-weewx-html
path: test/e2e-tests/artifacts-custom-binding-weewx-html
- name: Download mqtt html
uses: actions/download-artifact@v3
with:
name: artifacts-mqtt-weewx-html
path: test/e2e-tests/artifacts-mqtt-weewx-html
- name: Download sensor status html
uses: actions/download-artifact@v3
with:
name: artifacts-sensor-status-weewx-html
path: test/e2e-tests/artifacts-sensor-status-weewx-html
- name: Download cmon html
uses: actions/download-artifact@v3
with:
name: artifacts-cmon-weewx-html
path: test/e2e-tests/artifacts-cmon-weewx-html
- name: Run playwright tests
run: yarn run test:e2e
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: test/e2e-tests/playwright-report