我想用Github Actions测试我的react应用程序,我需要Django运行一些测试,但是Django有
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
October 15, 2021 - 03:32:25
Django version 3.2.6, using settings 'controller.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
消息锁定bash,有什么想法我可以启动Django内部的动作,使动作继续运行吗?
这是我当前的动作
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Installing dependecies
run:
./install.sh
shell:
bash
- name: Testing backend
run:
./backend-test.sh
shell:
bash
- name: Starting backend
run:
./backend.sh > /dev/null 2>&1
shell:
bash
- name: Testing frontend
run:
./frontend-test.sh
shell:
bash
backend。sh做这个
# Backend test script
cd backend/ &&
sudo service postgresql start &&
source .venv/bin/activate &&
python3 manage.py test
您应该在命令runningbackend.sh脚本的末尾添加&
,以便在后台运行它。进程ID将打印到屏幕上,您可以运行其他脚本/命令
- name: Starting backend
run:
./backend.sh > /dev/null 2>&1 &
shell:
bash