feature:服务端首页新增提示 #179
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: server_Test When commit.yml | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: ./YuYuWechatV2_Server | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Compile with PyInstaller | |
run: | | |
pip install pyinstaller | |
pyinstaller YuYuWechatV2_Server.spec | |
- name: Run bat file and test | |
id: run_test | |
run: | | |
Start-Process -FilePath "D:\a\YuYuWechat\YuYuWechat\YuYuWechatV2_Server\dist\YuYuWechatV2_Server_run.bat" -NoNewWindow | |
Start-Sleep -Seconds 10 # 等待服务器启动 | |
$response = Invoke-RestMethod -Uri http://127.0.0.1:8000/wechat/ping/ -UseBasicParsing | |
Write-Output "Response: $response" | |
if ($response.status -eq "pong") { | |
Write-Output "Test passed" | |
echo "test_passed=true" >> $env:GITHUB_ENV | |
} else { | |
Write-Output "Test failed" | |
exit 1 | |
} |