-
Notifications
You must be signed in to change notification settings - Fork 41
128 lines (117 loc) · 3.55 KB
/
testing.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
name: Cross-browser test automation
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.8]
services:
db:
image: mysql:8.0
volumes:
- database:/var/lib/mysql
env:
MYSQL_ROOT_PASSWORD: ubyssey
MYSQL_DATABASE: ubyssey
ports: ['3306:3306']
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3
selenium-chrome:
image: selenium/standalone-chrome:latest
ports:
- 4444:4444
- 7900:7900
options: >-
--shm-size=2g
selenium-edge:
image: selenium/standalone-edge:latest
ports:
- 4445:4444
- 7901:7900
options: >-
--shm-size=2g
selenium-firefox:
image: selenium/standalone-firefox:latest
ports:
- 4446:4444
- 7902:7900
options: >-
--shm-size=2g
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python packages and dependencies
run: |
pip install -r requirements-prd.txt --use-pep517
pip install requests --upgrade
- name: Set up Node.js environment
uses: actions/setup-node@v2.1.4
with:
node-version: 14.x
- name: Run gulp to ready frontend static files for production
run: |
cd ubyssey/static_src
npm install -g gulp
npm install
npm ddp
gulp build
rm -rf node_modules
cd ../../
- name: Collect static files
run: |
export DJANGO_SETTINGS_MODULE="config.settings.development"
python manage.py collectstatic --noinput
rm -rf .git/ ubyssey/static_src/
- name: Download wait-for-it script
run: |
curl -sSL https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -o wait-for-it.sh
chmod +x wait-for-it.sh
- name: Wait for Selenium to be ready
run: ./wait-for-it.sh localhost:4444 --timeout=60 -- echo "Selenium is up"
- name: Run test on chrome browser
run: |
export DJANGO_SETTINGS_MODULE="config.settings.development"
pip install selenium
export BROWSER=chrome
export CI_ENVIRONMENT=testing
python manage.py test
env:
SQL_HOST: 0.0.0.0
SQL_DATABASE: ubyssey
SQL_USER: root
SQL_PASSWORD: ubyssey
- name: Run test on firefox browser
run: |
export DJANGO_SETTINGS_MODULE="config.settings.development"
pip install selenium
export BROWSER=firefox
export CI_ENVIRONMENT=testing
python manage.py test
env:
SQL_HOST: 0.0.0.0
SQL_DATABASE: ubyssey
SQL_USER: root
SQL_PASSWORD: ubyssey
- name: Run test on edge browser
run: |
export DJANGO_SETTINGS_MODULE="config.settings.development"
pip install selenium
export BROWSER=edge
export CI_ENVIRONMENT=testing
python manage.py test
env:
SQL_HOST: 0.0.0.0
SQL_DATABASE: ubyssey
SQL_USER: root
SQL_PASSWORD: ubyssey