Skip to content

Commit 3da144d

Browse files
committed
ci(ci.yml): add new job to run Velocity
1 parent 86205a2 commit 3da144d

1 file changed

Lines changed: 72 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
if: always()
4949
uses: actions/upload-artifact@v5
5050
with:
51-
name: test-reports-java${{ matrix.java }}
51+
name: liteMacro-test-reports
5252
path: |
5353
**/build/test-results/test/**
5454
**/build/reports/tests/test/**
@@ -57,8 +57,78 @@ jobs:
5757
if: always()
5858
uses: actions/upload-artifact@v5
5959
with:
60-
name: build-artifacts-java${{ matrix.java }}
60+
name: liteMacro-artifacts
6161
path: |
6262
**/build/libs/*.jar
6363
!**/*-sources.jar
6464
!**/*-javadoc.jar
65+
66+
velocity:
67+
name: Velocity Test
68+
runs-on: ubuntu-latest
69+
needs: build-test
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v5
73+
74+
- name: Set up JDK 21 (for Gradle build)
75+
uses: actions/setup-java@v5
76+
with:
77+
distribution: zulu
78+
java-version: "21"
79+
cache: gradle
80+
81+
- name: Make gradlew executable
82+
run: chmod +x gradlew
83+
84+
- name: Build plugin
85+
run: ./gradlew --no-daemon build --stacktrace
86+
87+
- name: Resolve plugin jar
88+
id: jar
89+
shell: bash
90+
run: |
91+
PLUGIN_JAR=$(ls -1 build/libs/*.jar | grep -vE 'sources|javadoc' | head -n1)
92+
echo "jar=$PLUGIN_JAR" >> "$GITHUB_OUTPUT"
93+
echo "Using plugin jar: $PLUGIN_JAR"
94+
95+
- name: Prepare minimal velocity.toml
96+
run: |
97+
mkdir -p .ci
98+
cat > .ci/velocity.toml <<'EOF'
99+
# Minimal config for CI
100+
bind = "0.0.0.0:25577"
101+
motd = "CI Velocity"
102+
show-max-players = 1
103+
online-mode = false
104+
force-key-authentication = false
105+
EOF
106+
107+
- name: Start Velocity (Docker)
108+
run: |
109+
docker run -d --name velocity-ci \
110+
-e TYPE=VELOCITY \
111+
-p 25577:25577 \
112+
-v "$(pwd)/.ci/velocity.toml:/server/velocity.toml:ro" \
113+
-v "$(pwd)/build/libs:/server/plugins" \
114+
itzg/bungeecord
115+
116+
- name: Wait for boot & plugin load
117+
shell: bash
118+
run: |
119+
set -e
120+
PATTERN="liteMarco initialized"
121+
for i in {1..60}; do
122+
if docker logs velocity-ci 2>&1 | grep -q "$PATTERN"; then
123+
echo "✅ Plugin loaded: found '$PATTERN' in logs"
124+
exit 0
125+
fi
126+
sleep 2
127+
done
128+
echo "❌ Timeout waiting for plugin to load. Last logs:"
129+
docker logs velocity-ci || true
130+
exit 1
131+
132+
- name: Stop container
133+
if: always()
134+
run: docker rm -f velocity-ci || true

0 commit comments

Comments
 (0)