-
Notifications
You must be signed in to change notification settings - Fork 66
79 lines (79 loc) · 2.69 KB
/
bk-login.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
name: bklogin_ci_check
on:
push:
branches: [ main, pre_*, ft_*, release/* ]
paths:
- "src/bk-login/**"
- "src/idp-plugins/**"
pull_request:
branches: [ main, pre_*, ft_*, release/* ]
paths:
- "src/bk-login/**"
- "src/idp-plugins/**"
jobs:
check:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: 'src/bk-login/requirements_dev.txt'
- name: create idp plugin symbolic link
run: |
ln -s $(pwd)/src/idp-plugins/idp_plugins $(pwd)/src/bk-login/bklogin
- name: Install dependencies
run: pip install -r src/bk-login/requirements_dev.txt
- name: Format & Lint with ruff
run: |
ruff format src/bk-login --config=src/bk-login/pyproject.toml --no-cache
ruff check src/bk-login --config=src/bk-login/pyproject.toml --no-cache
- name: Lint with mypy
run: |
mypy src/bk-login --config-file=src/bk-login/pyproject.toml
test:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Start MySQL Container
uses: samin/[email protected]
with:
mysql version: "8.0"
mysql database: bk-login
mysql user: root
mysql password: root_pwd
mysql root password: root_pwd
- name: Start Redis Container
uses: supercharge/[email protected]
with:
redis-version: "3.2.0"
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: 'src/bk-login/requirements_dev.txt'
- name: create idp plugin symbolic link
run: |
ln -s $(pwd)/src/idp-plugins/idp_plugins $(pwd)/src/bk-login/bklogin
- name: Install dependencies
run: pip install -r src/bk-login/requirements_dev.txt
- name: Run unittest
working-directory: src/bk-login
run: |
# random secret
export BK_APP_SECRET="fod6MKVTVi_3M5HgGoj-qI7b3l0dgCzTBwGypnDz4vg="
export BK_USER_APP_SECRET="Vi_3M5HgGogCzTBwGypnDz4vgfod6MKVTj-qI7b3l0d="
# random secret key
export BKKRILL_ENCRYPT_SECRET_KEY="tttHSBLiVdQPItrfy7n9dV7AxAUMZpYVkD6IHMbL0VE="
export BK_DOMAIN="example.com"
export BK_COMPONENT_API_URL=""
export MYSQL_PASSWORD=root_pwd
export MYSQL_HOST="127.0.0.1"
export DJANGO_SETTINGS_MODULE=bklogin.settings
pytest ./tests