-
Notifications
You must be signed in to change notification settings - Fork 378
58 lines (52 loc) · 1.6 KB
/
unittest.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
name: Unittest
on:
push:
branches: [ master, develop, release*, feature* ]
pull_request:
branches: [ master, develop, release*, feature* ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
max-parallel: 4
matrix:
python-version: [3.6]
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 Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
# prepare env
source scripts/develop/sites/community/env.sh
export APP_ID="bk_sops"
export APP_TOKEN="{APP_TOKEN}"
export BK_PAAS_HOST="BK_PAAS_HOST"
export BK_CC_HOST=""
export BK_JOB_HOST=""
export RUN_VER="open"
export OPEN_VER="community"
export BKAPP_AUTO_UPDATE_VARIABLE_MODELS="0"
export BKAPP_AUTO_UPDATE_COMPONENT_MODELS="0"
export BK_IAM_HOST="BK_IAM_HOST"
export BK_API_URL_TMPL="BK_API_URL_TMPL"
# add local_settings.py
echo '# -*- coding: utf-8 -*-
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "db.sqlite3",
}
}
LOG_LEVEL = "DEBUG"
BK_IAM_SKIP = 1' > local_settings.py
# rm pipeline tests, we will not longer need it after integrate with bamboo-engine
rm -rf pipeline/tests
# run unittest
python manage.py test