Merge branch 'master' of http://47.109.37.87:3000/by2025/SmartParks
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 7m0s

This commit is contained in:
mocheng 2025-06-24 17:01:10 +08:00
commit eff9a0fbaa

View File

@ -8,47 +8,45 @@ jobs:
steps:
- name: Checkout code
uses: http://47.109.37.87:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
# uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
uses: http://127.0.0.1:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
with:
node-version: '20' # 指定版本,如 18、20或 'lts'
# - name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: maven
fetch-depth: 1 # 只拉取最新一次提交
- name: Maven
run: mvn clean install
- name: Build with Maven
run: mvn -B clean package -DskipTests --file pom.xml
run: mvn -B package -DskipTests -pl ruoyi-modules/Property -am
- name: cp
run: copy ./ruoyi-modules/Property/target/Property.jar C:\devtool\server
- name: kill
run: cmd /c for /f "tokens=5" %a in ('netstat -ano ^| findstr ":10001" ^| findstr "LISTENING"') do @taskkill /F /PID %a >nul 2>nul
- name: run
run: java -jar C:\devtool\server\Property.jar
# - copy ./ruoyi-modules/Property/target/Property.jar C:\devtool\server
# - pwd
# - java -jar ./docker/jar/Property.jar
# - name: cd
# run: cd ruoyi-modules/Property
# - name: Build with Maven
# run: mvn -B clean package -DskipTests --file pom.xml
- name: Start Spring Cloud Services
run: |
# 启动顺序示例:注册中心 -> 配置中心 -> 网关 -> 业务服务
echo "Starting Server..."
java -jar $(find target -name '*Property*.jar' | head -1) &
SERVER_PIDS[0]=$!
# - name: Start Spring Cloud Services
# run: |
# # 启动顺序示例:注册中心 -> 配置中心 -> 网关 -> 业务服务
# echo "Starting Server..."
# java -jar Property.jar
# SERVER_PIDS[0]=$!
# 等待注册中心启动
sleep 30
# # 等待注册中心启动
# sleep 30
# 输出服务状态
for pid in "${SERVER_PIDS[@]}"; do
if ps -p $pid > /dev/null; then
echo "Service with PID $pid is running."
else
echo "Service with PID $pid has stopped."
exit 1
fi
done
# done
# 保持工作流运行,避免服务被终止
wait
env:
JAVA_OPTS: "-Xmx512m -Xms256m"
timeout-minutes: 20
# wait
# env:
# JAVA_OPTS: "-Xmx512m -Xms256m"
# timeout-minutes: 20