This repository has been archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
194 lines (154 loc) · 5.25 KB
/
run-tests.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
name: Tests
on: [push]
jobs:
selenium-pages:
name: Selenium pages
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Pip install
run: |
pip install --upgrade pip
pip install -e .[dev]
- uses: autoreduction/autoreduce-actions/build@main
with:
package_name: autoreduce_frontend
- name: Remote dotenv to Environment (configserver alike)
uses: Steph0/[email protected]
with:
repository: "autoreduction/autoreduce-workspace"
- name: Start Selenium docker daemon
run: docker run --name selenium --rm -d --network=host -v /dev/shm:/dev/shm selenium/standalone-chrome:4.1.2-20220217
- name: Wait until the Selenium instance is ready
run: until nc -w 1 127.0.0.1 4444; do sleep 1; done
- name: Install Tox
run: python -m pip install tox tox-gh-actions
- name: Run Selenium Pages tests with tox
run: tox -e pages
- uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
name: codecov-umbrella
flags: webapp-pages
fail_ci_if_error: true
verbose: true
- uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots_and_reports
path: |
~/.autoreduce/selenium_tests/screenshots
~/.autoreduce/selenium_tests/a11y_reports
selenium-integration:
name: Selenium integration
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Pip install
run: |
pip install --upgrade pip
pip install -e .[dev]
- uses: autoreduction/autoreduce-actions/build@main
with:
package_name: autoreduce_frontend
- name: Remote dotenv to Environment (configserver alike)
uses: Steph0/[email protected]
with:
repository: "autoreduction/autoreduce-workspace"
- name: Run MySQL Docker
run: docker run --rm --name mysql-ar -e MYSQL_ROOT_PASSWORD=password -d --network=host mysql:latest
- name: Wait until MySQL is ready
run: until nc -w 1 127.0.0.1 3306; do sleep 1; done
- name: Start Autoreduce REST API
run: gunicorn autoreduce_rest_api.autoreduce_django.wsgi:application -b 127.0.0.1:8001 -e TESTING_MYSQL_DB=true &
- name: Start Selenium docker daemon
run: docker run --name selenium --rm -d --network=host -v /dev/shm:/dev/shm selenium/standalone-chrome:4.1.2-20220217
- name: Wait until the Selenium instance is ready
run: until nc -w 1 127.0.0.1 4444; do sleep 1; done
- name: Install Tox
run: python -m pip install tox tox-gh-actions
- name: Run Selenium Integration tests with tox
run: tox -e integration
- uses: codecov/codecov-action@v2
with:
files: ./coverage.xml
name: codecov-umbrella
flags: webapp-integration
fail_ci_if_error: true
verbose: true
- uses: actions/upload-artifact@v3
if: failure()
with:
name: screenshots_and_reports
path: |
~/.autoreduce/selenium_tests/screenshots
~/.autoreduce/selenium_tests/a11y_reports
dependency-check:
name: Dependency-Check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ job.container.image }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ job.container.image }}-pip-
- name: Pip install
run: |
pip install --upgrade pip
pip install -e .[dev]
Inspection:
name: Code Inspection
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Pip install
run: |
pip install --upgrade pip
pip install -e .[dev]
- uses: autoreduction/autoreduce-actions/build@main
with:
package_name: autoreduce_frontend
- name: Install Tox
run: python -m pip install tox tox-gh-actions
- name: Run code inspection with tox
run: tox -e code_inspection