Update release Webhook #207
Workflow file for this run
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
| name: Java CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| integration-tests: | |
| name: Plugin Integration Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| minecraft-version: ['1.21', '1.21.1', '1.21.3', '1.21.4'] | |
| services: | |
| minecraft: | |
| image: itzg/minecraft-server:latest | |
| ports: | |
| - 25565:25565 | |
| - 7000:7000 | |
| env: | |
| EULA: "TRUE" | |
| VERSION: "${{ matrix.minecraft-version }}" | |
| TYPE: "PAPER" | |
| ENABLE_RCON: "true" | |
| RCON_PASSWORD: "testing" | |
| RCON_PORT: 25575 | |
| options: >- | |
| --health-cmd "mc-health" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '21' | |
| - name: Build plugin | |
| run: mvn clean package -DskipTests | |
| - name: Wait for Minecraft server to start | |
| run: | | |
| echo "Waiting for Minecraft server to be ready..." | |
| timeout 300 bash -c 'until docker exec $(docker ps -q --filter ancestor=itzg/minecraft-server:latest) mc-health; do sleep 5; done' | |
| echo "Minecraft server is ready!" | |
| - name: Copy plugin to server | |
| run: | | |
| CONTAINER_ID=$(docker ps -q --filter ancestor=itzg/minecraft-server:latest) | |
| docker cp target/MinecraftServerAPI-*.jar $CONTAINER_ID:/data/plugins/ | |
| docker exec $CONTAINER_ID mkdir -p /data/plugins/MinecraftServerAPI | |
| docker cp docker/test.config.yml $CONTAINER_ID:/data/plugins/MinecraftServerAPI/config.yml | |
| - name: Reload server and verify plugin | |
| run: | | |
| CONTAINER_ID=$(docker ps -q --filter ancestor=itzg/minecraft-server:latest) | |
| docker exec $CONTAINER_ID rcon-cli reload confirm | |
| sleep 30 | |
| # Check if plugin is loaded by looking for its name in the plugins list | |
| PLUGIN_CHECK=$(docker exec $CONTAINER_ID rcon-cli plugins | grep -i MinecraftServerAPI || echo "Plugin not found") | |
| if [[ "$PLUGIN_CHECK" == *"Plugin not found"* ]]; then | |
| echo "Plugin failed to load properly" | |
| docker exec $CONTAINER_ID cat /data/logs/latest.log | |
| exit 1 | |
| else | |
| echo "Plugin loaded successfully: $PLUGIN_CHECK" | |
| fi | |
| - name: Test API endpoint | |
| run: | | |
| # Test that the API is responding | |
| curl -f -H "Authorization: TestKey" http://localhost:7000/v1/ping || (echo "API endpoint not responding" && exit 1) | |
| echo "API endpoint is working!" |