-
-
Notifications
You must be signed in to change notification settings - Fork 19
GH-1051 Add integrational tests #1051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+99
−0
Closed
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3ba9acc
Create test-mc-versions.yml
vLuckyyy 8578de2
use v4 of download artifact.
vLuckyyy 2d1e875
test
vLuckyyy 5361c9f
TEST
vLuckyyy d53fc04
fix jq.
vLuckyyy 223814e
build JAR and fix PaperMC build retrieval
vLuckyyy c16fd5a
Fix papermc resolving.
vLuckyyy 0c22ce4
Add separate env for minecraft version
vLuckyyy a13e84e
Add PLUGIN_JAR env.
vLuckyyy 1904391
Expose MC_VERSION for every step
vLuckyyy 4032569
Fix missing PIDs
vLuckyyy 167f451
Use 25560 port.
vLuckyyy 6adde98
disable fail-fast
vLuckyyy 42db581
Use java 21
vLuckyyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: MC Plugin Compatibility Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
test-minecraft-versions: | ||
runs-on: self-hosted | ||
strategy: | ||
matrix: | ||
mc_version: [1.18.2, 1.19.4, 1.20.6, 1.21.7] | ||
env: | ||
MC_VERSION: ${{ matrix.mc_version }} | ||
PLUGIN_GLOB: "eternalcore-plugin/build/libs/EternalCore*.jar" | ||
MC_PORT: 25560 | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
|
||
- name: Make gradlew executable | ||
run: chmod +x gradlew | ||
|
||
- name: Build the plugin JAR | ||
run: ./gradlew clean eternalcore-plugin:shadowJar | ||
|
||
- name: Find plugin JAR | ||
id: find-jar | ||
run: | | ||
PLUGIN_JAR=$(find ./eternalcore-plugin/build/libs -name 'EternalCore*.jar' | head -n1) | ||
echo "PLUGIN_JAR=$PLUGIN_JAR" >> $GITHUB_ENV | ||
if [ -z "$PLUGIN_JAR" ]; then | ||
echo "❌ Plugin JAR not found!" | ||
exit 1 | ||
fi | ||
|
||
- name: Get latest PaperMC build number | ||
id: get_build_number | ||
run: | | ||
BUILD_NUMBER=$(curl -s "https://api.papermc.io/v2/projects/paper/versions/${MC_VERSION}/builds" \ | ||
| jq '.builds | max_by(.build) | .build') | ||
echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT | ||
|
||
- name: Setup PaperMC server for $MC_VERSION | ||
run: | | ||
mkdir mc-server | ||
cd mc-server | ||
wget "https://api.papermc.io/v2/projects/paper/versions/${MC_VERSION}/builds/${{ steps.get_build_number.outputs.build_number }}/downloads/paper-${MC_VERSION}-${{ steps.get_build_number.outputs.build_number }}.jar" \ | ||
-O paper.jar | ||
mkdir plugins | ||
cp "../$PLUGIN_JAR" plugins/ | ||
|
||
- name: Agree to EULA | ||
run: echo "eula=true" > mc-server/eula.txt | ||
|
||
- name: Configure server.properties | ||
run: | | ||
cat > mc-server/server.properties <<EOF | ||
server-port=${MC_PORT} | ||
allow-nether=false | ||
level-type=FLAT | ||
max-world-size=16 | ||
EOF | ||
|
||
- name: Configure bukkit.yml | ||
run: | | ||
cat > mc-server/bukkit.yml <<EOF | ||
settings: | ||
allow-end: false | ||
EOF | ||
|
||
- name: Run server and fail on errors | ||
working-directory: mc-server | ||
run: | | ||
java -Xmx1G -jar paper.jar nogui > server.log 2>&1 & | ||
PID=$! | ||
echo "Started MC ${MC_VERSION} on port ${MC_PORT} (PID=${PID})" | ||
sleep 60 | ||
kill $PID || true | ||
wait $PID || true | ||
if grep -iE 'error|exception|failed' server.log; then | ||
echo "❌ Errors detected in server.log" | ||
cat server.log | ||
exit 1 | ||
else | ||
echo "✅ No errors detected for MC ${MC_VERSION}" | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.