SmartParks/.gitea/workflows/dev.yml
mocheng f481a7a733
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
cicd
2025-06-23 14:34:48 +08:00

49 lines
1.3 KiB
YAML

name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: windows
steps:
- name: Checkout code
# uses: http://47.109.37.87:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
uses: actions/checkout@v4
# - name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
# java-version: '17'
# distribution: 'temurin'
# cache: maven
- 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]=$!
# 等待注册中心启动
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
# 保持工作流运行,避免服务被终止
wait
env:
JAVA_OPTS: "-Xmx512m -Xms256m"
timeout-minutes: 20