-
Notifications
You must be signed in to change notification settings - Fork 79
executable file
·40 lines (38 loc) · 1.21 KB
/
[server]Test When commit.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
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
}