Create secure.json in workflow before running tests

Add step to create secure.json file before tests.
This commit is contained in:
Yaosanqi137
2025-11-13 20:09:12 +08:00
committed by GitHub
parent d24e581e7d
commit 0750d15e9f
+18
View File
@@ -25,6 +25,24 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r ./src/backend/requirements.txt
# 新增步骤:在运行测试前创建 secure.json 文件
- name: Create secure.json
run: |
# 确保目录存在
mkdir -p ./src/backend/item_manager/
# 使用 echo 和重定向操作符 > 来创建文件并写入内容
echo '{
"SECRET_KEY": "114514",
"SMTP": {
"EMAIL_HOST": "",
"EMAIL_PORT": 465,
"EMAIL_HOST_USER": "",
"EMAIL_HOST_PASSWORD": "",
"EMAIL_USE_SSL": true,
"DEFAULT_FROM_EMAIL": "",
"ADMINS": [["", ""]]
}
}' > ./src/backend/item_manager/secure.json
- name: Run Tests
run: |
python ./src/backend/manage.py test