-
Notifications
You must be signed in to change notification settings - Fork 54
53 lines (51 loc) · 1.31 KB
/
python_unit_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
name: Python Unit Test
on:
workflow_dispatch:
push:
paths:
- "dbm-ui/backend/**"
- "dbm-ui/config/**"
pull_request:
paths:
- "dbm-ui/backend/**"
- "dbm-ui/config/**"
jobs:
run:
runs-on: ubuntu-20.04
env:
OS: ubuntu-latest
PYTHON: "3.6"
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Setup Mysql
run: |
sudo systemctl start mysql.service
- name: "执行单元测试"
run: |-
source ./dbm-ui/scripts/ci/env.sh
export DBA_APP_BK_BIZ_ID=0
export DB_PASSWORD=root
export REPORT_DB_PASSWORD=root
export REDIS_HOST="localhost"
export REDIS_PORT=6379
export BROKER_URL="redis://localhost:6379/0"
./dbm-ui/scripts/ci/bk_ci.sh