This commit is contained in:
parent
91e0425bbd
commit
f3b448abcf
@ -6,14 +6,42 @@ jobs:
|
|||||||
Explore-Gitea-Actions:
|
Explore-Gitea-Actions:
|
||||||
runs-on: windows
|
runs-on: windows
|
||||||
steps:
|
steps:
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
- name: Checkout code
|
||||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
uses: actions/checkout@v4
|
||||||
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
||||||
- name: Check out repository code
|
- name: Set up JDK 17
|
||||||
uses: actions/checkout@v3
|
uses: actions/setup-java@v4
|
||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
with:
|
||||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
java-version: '17'
|
||||||
- name: List files in the repository
|
distribution: 'temurin'
|
||||||
|
cache: maven
|
||||||
|
|
||||||
|
- name: Build with Maven
|
||||||
|
run: mvn -B clean package -DskipTests --file pom.xml
|
||||||
|
|
||||||
|
- name: Start Spring Cloud Services
|
||||||
run: |
|
run: |
|
||||||
ls ${{ gitea.workspace }}
|
# 启动顺序示例:注册中心 -> 配置中心 -> 网关 -> 业务服务
|
||||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user