Skip to content

Add CI workflow to test/build PrototypeMachinery and ModernBackend#1

Merged
KasumiNova merged 2 commits intomasterfrom
copilot/add-ci-for-prototypemachinery
Feb 4, 2026
Merged

Add CI workflow to test/build PrototypeMachinery and ModernBackend#1
KasumiNova merged 2 commits intomasterfrom
copilot/add-ci-for-prototypemachinery

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

需要一个自动化 CI:先构建测试,再产出 PrototypeMachinery 本体与 PrototypeMachinery-ModernBackend 附属模组。

  • CI workflow
    • New GitHub Actions workflow that runs tests/builds for the main mod and Modern Backend, then uploads both artifacts.

Example workflow excerpt:

- 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
- name: Build Modern Backend
  working-directory: modern-backend
  run: ./gradlew build -x test -Pjava_toolchain=21 --no-daemon

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add CI for PrototypeMachinery module Add CI to build PrototypeMachinery and ModernBackend (pending) Feb 4, 2026
Copilot AI requested a review from KasumiNova February 4, 2026 03:42
Co-authored-by: KasumiNova <48862050+KasumiNova@users.noreply.github.com>
Copilot AI changed the title Add CI to build PrototypeMachinery and ModernBackend (pending) Add CI workflow to test/build PrototypeMachinery and ModernBackend Feb 4, 2026
@KasumiNova KasumiNova marked this pull request as ready for review February 4, 2026 04:19
Copilot AI review requested due to automatic review settings February 4, 2026 04:19
@KasumiNova KasumiNova merged commit a14217d into master Feb 4, 2026
5 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new GitHub Actions workflow to automate testing and building of both the main PrototypeMachinery mod and the PrototypeMachinery-ModernBackend addon. The workflow is triggered on pushes to master, pull requests, and manual dispatch, and uploads both built artifacts for distribution.

Changes:

  • New CI workflow that runs tests and builds for both the main mod (Java 8) and Modern Backend addon (Java 21+)
  • Automated artifact uploads for both built jar files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +34
- name: Test Modern Backend
working-directory: modern-backend
run: ./gradlew test -Pjava_toolchain=21 --no-daemon
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.
Comment on lines +19 to +24
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: gradle
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.
distribution: temurin
java-version: 21
cache: gradle

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.
Comment on lines +36 to +38
- name: Build Modern Backend
working-directory: modern-backend
run: ./gradlew build -x test -Pjava_toolchain=21 --no-daemon
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants