Skip to content

feat: Add runtime scroll testing #54

feat: Add runtime scroll testing

feat: Add runtime scroll testing #54

name: Test Scrolls
on:
pull_request:
paths:
- 'scrolls/**'
- '.github/workflows/test-scrolls-runtime.yml'
- 'scripts/test-scroll-runtime.sh'
push:
branches:
- master
paths:
- 'scrolls/**'
- '.github/workflows/test-scrolls-runtime.yml'
- 'scripts/test-scroll-runtime.sh'
jobs:
# Test all Minecraft Vanilla versions
test-vanilla:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Download druid-cli
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid"
out-file-path: "/tmp"
- name: Download druid_rcon plugin
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid_rcon"
out-file-path: "/tmp"
- name: Download druid_rcon_web_rust plugin
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid_rcon_web_rust"
out-file-path: "/tmp"
- name: Make binaries executable
run: |
chmod +x /tmp/druid /tmp/druid_rcon /tmp/druid_rcon_web_rust
/tmp/druid version
- name: Test all Vanilla versions
env:
TIMEOUT: 600
run: |
chmod +x scripts/test-scroll-runtime.sh
FAILED=0
for scroll in scrolls/minecraft/minecraft-vanilla/*/; do
echo "Testing $scroll"
if ! scripts/test-scroll-runtime.sh "${scroll%/}"; then
echo "FAILED: $scroll"
FAILED=$((FAILED + 1))
fi
done
if [ $FAILED -gt 0 ]; then
echo "Total failures: $FAILED"
exit 1
fi
timeout-minutes: 300 # 5 hours for ~81 versions
# Test all PaperMC versions
test-paper:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Download druid-cli
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid"
out-file-path: "/tmp"
- name: Download druid_rcon plugin
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid_rcon"
out-file-path: "/tmp"
- name: Download druid_rcon_web_rust plugin
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid_rcon_web_rust"
out-file-path: "/tmp"
- name: Make binaries executable
run: |
chmod +x /tmp/druid /tmp/druid_rcon /tmp/druid_rcon_web_rust
/tmp/druid version
- name: Test all PaperMC versions
env:
TIMEOUT: 600
run: |
chmod +x scripts/test-scroll-runtime.sh
FAILED=0
for scroll in scrolls/minecraft/papermc/*/; do
echo "Testing $scroll"
if ! scripts/test-scroll-runtime.sh "${scroll%/}"; then
echo "FAILED: $scroll"
FAILED=$((FAILED + 1))
fi
done
if [ $FAILED -gt 0 ]; then
echo "Total failures: $FAILED"
exit 1
fi
timeout-minutes: 300
# Test all Spigot versions
test-spigot:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Download druid-cli
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid"
out-file-path: "/tmp"
- name: Download druid_rcon plugin
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid_rcon"
out-file-path: "/tmp"
- name: Download druid_rcon_web_rust plugin
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid_rcon_web_rust"
out-file-path: "/tmp"
- name: Make binaries executable
run: |
chmod +x /tmp/druid /tmp/druid_rcon /tmp/druid_rcon_web_rust
/tmp/druid version
- name: Test all Spigot versions
env:
TIMEOUT: 600
run: |
chmod +x scripts/test-scroll-runtime.sh
FAILED=0
for scroll in scrolls/minecraft/minecraft-spigot/*/; do
echo "Testing $scroll"
if ! scripts/test-scroll-runtime.sh "${scroll%/}"; then
echo "FAILED: $scroll"
FAILED=$((FAILED + 1))
fi
done
if [ $FAILED -gt 0 ]; then
echo "Total failures: $FAILED"
exit 1
fi
timeout-minutes: 300
# Test all LGSM versions
test-lgsm:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install SteamCMD (for LGSM games)
run: |
nix-env -iA nixpkgs.steamcmd || true
- name: Download druid-cli
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid"
out-file-path: "/tmp"
- name: Download druid_rcon plugin
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid_rcon"
out-file-path: "/tmp"
- name: Download druid_rcon_web_rust plugin
uses: robinraju/release-downloader@v1
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid_rcon_web_rust"
out-file-path: "/tmp"
- name: Make binaries executable
run: |
chmod +x /tmp/druid /tmp/druid_rcon /tmp/druid_rcon_web_rust
/tmp/druid version
- name: Create non-root user for LGSM
run: |
# LGSM cannot run as root, create test user
useradd -m -s /bin/bash lgsm-test || true
# Give user access to test files
chown -R lgsm-test:lgsm-test .
chmod -R 755 .
# Allow user to run druid binaries
chmod 755 /tmp/druid /tmp/druid_rcon /tmp/druid_rcon_web_rust
- name: Test released LGSM scrolls only
env:
TIMEOUT: 600
run: |
chmod +x scripts/test-scroll-runtime.sh
# Only test LGSM scrolls that are actually released (from release.yml)
RELEASED_LGSM=(
"scrolls/lgsm/pwserver"
"scrolls/lgsm/arkserver"
"scrolls/lgsm/untserver"
"scrolls/lgsm/dayzserver"
"scrolls/lgsm/sdtdserver"
"scrolls/lgsm/gmodserver"
"scrolls/lgsm/cs2server"
"scrolls/lgsm/pzserver"
"scrolls/lgsm/terrariaserver"
"scrolls/lgsm/csgoserver"
)
FAILED=0
for scroll in "${RELEASED_LGSM[@]}"; do
echo "Testing $scroll"
# Run as non-root user (LGSM requirement)
if ! sudo -u lgsm-test bash -c "cd $PWD && scripts/test-scroll-runtime.sh '$scroll'"; then
echo "FAILED: $scroll"
FAILED=$((FAILED + 1))
fi
done
if [ $FAILED -gt 0 ]; then
echo "Total failures: $FAILED"
exit 1
fi
timeout-minutes: 300