feat(mongodb): 禁用/开启MongoDB #3864 #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
strategy: | |
matrix: | |
python-version: [ "3.6", "3.10"] | |
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@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Save Python version | |
run: echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
- 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 |