From e8eaa729479a3d0beb53206e4f0ffedde817d73c Mon Sep 17 00:00:00 2001 From: "Flemming N. Larsen" Date: Tue, 29 Sep 2026 19:33:17 +0200 Subject: [PATCH] CI: run Java bots on Java 25; set the exec bit in the test helper - validate.yml and publish-catalog.yml set up Temurin 25 before the smoke check. Without it the runner's default Java 17 ran the Java bots, which breaks bots that use Java 22+ multi-file source launch as the Rumble does. - add_java_bot now marks its .sh executable. The validator has required the bit since c043c77, so two integration tests failed on POSIX; no validate run had exercised them since. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish-catalog.yml | 5 +++++ .github/workflows/validate.yml | 5 +++++ tests/test_validate_bot.py | 2 ++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/publish-catalog.yml b/.github/workflows/publish-catalog.yml index ae53cf0..1f056f0 100644 --- a/.github/workflows/publish-catalog.yml +++ b/.github/workflows/publish-catalog.yml @@ -22,6 +22,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.12' + # Java bots run from source (Java 22+ multi-file launch); match the Rumble's JVM. + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '25' - run: python scripts/validate_bot.py --root . --owner '${{ github.event.pull_request.user.login }}' --smoke --generate - run: | git config user.name 'github-actions[bot]' diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 6cb63c3..de49b1b 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -20,6 +20,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.12' + # Java bots run from source (Java 22+ multi-file launch); match the Rumble's JVM. + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '25' - run: python -m unittest discover -s tests -v - name: Reject hand-edited generated catalog files run: | diff --git a/tests/test_validate_bot.py b/tests/test_validate_bot.py index 76a9c92..19bfb0d 100644 --- a/tests/test_validate_bot.py +++ b/tests/test_validate_bot.py @@ -60,6 +60,8 @@ def add_java_bot(self, name: str) -> None: (destination / f"{name}.java").write_text("// dev.robocode.tankroyale.botapi", encoding="utf-8") for suffix in (".sh", ".cmd"): (destination / f"{name}{suffix}").write_text("", encoding="utf-8") + script = destination / f"{name}.sh" + script.chmod(script.stat().st_mode | 0o111) # the validator requires the executable bit on POSIX def add_team(self, name: str, members: list[str]) -> None: destination = self.root / "bots" / "python" / name