Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/build-mods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Mods

on:
push:
branches: ["master"]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: gradle
Comment on lines +19 to +24
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main PrototypeMachinery build.gradle.kts specifies a Java 8 toolchain with Azul vendor preference (lines 62-65), but the workflow only sets up Java 21 via actions/setup-java. While GitHub Actions ubuntu-latest runners typically include multiple Java versions, and Gradle's toolchain will use any available Java 8 JDK if Azul is not available, this could lead to inconsistent builds. Consider either: (1) adding org.gradle.java.installations.auto-download=true to the root gradle.properties to enable automatic toolchain provisioning, or (2) setting up Java 8 explicitly in the workflow using a matrix strategy with setup-java to ensure the preferred Azul JDK 8 is available.

Suggested change
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: gradle
- name: Setup Java 8 (Azul Zulu)
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 8
cache: gradle
- name: Setup Java 21 (Temurin)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

Copilot uses AI. Check for mistakes.

Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a step to ensure the Gradle wrapper is executable before running gradle commands. While the gradlew file is typically checked in with executable permissions, it's a common best practice in CI to explicitly set permissions. Add chmod +x gradlew before the first gradle command, or use chmod +x gradlew modern-backend/gradlew to set permissions for both wrappers.

Suggested change
- name: Ensure Gradle wrappers are executable
run: chmod +x gradlew modern-backend/gradlew

Copilot uses AI. Check for mistakes.
- name: Test PrototypeMachinery
run: ./gradlew test --no-daemon

- name: Build PrototypeMachinery
run: ./gradlew build -x test --no-daemon

- name: Test Modern Backend
working-directory: modern-backend
run: ./gradlew test -Pjava_toolchain=21 --no-daemon
Comment on lines +32 to +34
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modern-backend directory does not have a src/test directory or any test source files. Running ./gradlew test will likely succeed but not actually test anything meaningful. Consider either removing the test step for Modern Backend, or adding test sources if test coverage is needed for this module.

Copilot uses AI. Check for mistakes.

- name: Build Modern Backend
working-directory: modern-backend
run: ./gradlew build -x test -Pjava_toolchain=21 --no-daemon
Comment on lines +36 to +38
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Modern Backend build requires the main PrototypeMachinery jar to exist in ../build/libs before it can compile (see modern-backend/build.gradle lines 130-151 and 294-303). The build order in this workflow is correct since PrototypeMachinery is built before Modern Backend, but this dependency could be made more explicit and robust by checking that the jar exists or by failing earlier with a clear message if the PrototypeMachinery build step is skipped or fails.

Copilot uses AI. Check for mistakes.

- name: Upload PrototypeMachinery artifacts
uses: actions/upload-artifact@v4
with:
name: PrototypeMachinery
path: build/libs/*.jar
if-no-files-found: error

- name: Upload Modern Backend artifacts
uses: actions/upload-artifact@v4
with:
name: PrototypeMachinery-ModernBackend
path: modern-backend/build/libs/*.jar
if-no-files-found: error