-
Notifications
You must be signed in to change notification settings - Fork 7
91 lines (76 loc) · 2.27 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
name: test
on: [push, pull_request]
jobs:
frontend:
name: Build frontend
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎
uses: actions/checkout@master
- name: Setup node env 🏗
uses: actions/setup-node@v2.1.5
with:
node-version: ${{ matrix.node }}
check-latest: true
- name: Cache node_modules 📦
uses: actions/cache@v2.1.4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies 👨🏻💻
run: npm ci --prefer-offline --no-audit
working-directory: frontend
- name: Run linter 👀
run: npm run lint
working-directory: frontend
backend:
name: Build backend
runs-on: ubuntu-latest
# Service containers mysql to run with `runner-job`
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--name=mysql
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Check out code
uses: actions/checkout@v2
- name: SET MySQL Cnf
run: |
cat << EOF > my.cnf
[mysqld]
server-id=100
log_bin=ON
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
lower_case_table_names=1
default-time_zone = '+8:00'
[client]
default-character-set=utf8mb4
EOF
docker cp my.cnf mysql:/etc/mysql/conf.d/
docker restart mysql
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install wheel setuptools pip --upgrade
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Init Table
run: |
mysql -h127.0.0.1 -uroot -proot -e "CREATE DATABASE helpdesk CHARSET UTF8MB4;"
mysql -h127.0.0.1 -uroot -proot -e "show databases;"
- name: Run tests with pytest
run: pytest helpdesk/tests -W ignore::DeprecationWarning --junitxml=ci/ut-report.xml