Skip to content
Merged
Show file tree
Hide file tree
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
231 changes: 231 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Pull Request Check

on:
pull_request:
branches:
Expand All @@ -16,6 +17,12 @@ on:
- gradle.properties
- settings.gradle

permissions:
contents: read
actions: read
packages: read
pull-requests: write

jobs:
codec:
uses: ./.github/workflows/build_and_test.yml
Expand Down Expand Up @@ -184,3 +191,227 @@ jobs:
ci_build: true
pr_build: true
gametest: true

# ── Roseau API checks ──────────────────────────────────────────

codec-roseau:
needs: codec
uses: ./.github/workflows/roseau_check.yml
with:
module: codec
module_id: anvillib-codec

collision-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: collision
uses: ./.github/workflows/roseau_check.yml
with:
module: collision
module_id: anvillib-collision

config-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: config
uses: ./.github/workflows/roseau_check.yml
with:
module: config
module_id: anvillib-config

font-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: font
uses: ./.github/workflows/roseau_check.yml
with:
module: font
module_id: anvillib-font

integration-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: integration
uses: ./.github/workflows/roseau_check.yml
with:
module: integration
module_id: anvillib-integration

moveable-entity-block-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: moveable-entity-block
uses: ./.github/workflows/roseau_check.yml
with:
module: moveable-entity-block
module_id: anvillib-moveable-entity-block

multiblock-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: multiblock
uses: ./.github/workflows/roseau_check.yml
with:
module: multiblock
module_id: anvillib-multiblock

network-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: network
uses: ./.github/workflows/roseau_check.yml
with:
module: network
module_id: anvillib-network

recipe-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: recipe
uses: ./.github/workflows/roseau_check.yml
with:
module: recipe
module_id: anvillib-recipe

registrum-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: registrum
uses: ./.github/workflows/roseau_check.yml
with:
module: registrum
module_id: anvillib-registrum

rendering-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: rendering
uses: ./.github/workflows/roseau_check.yml
with:
module: rendering
module_id: anvillib-rendering

space-select-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: space-select
uses: ./.github/workflows/roseau_check.yml
with:
module: space-select
module_id: anvillib-space-select

sync-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: sync
uses: ./.github/workflows/roseau_check.yml
with:
module: sync
module_id: anvillib-sync

util-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: util
uses: ./.github/workflows/roseau_check.yml
with:
module: util
module_id: anvillib-util

wheel-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: wheel
uses: ./.github/workflows/roseau_check.yml
with:
module: wheel
module_id: anvillib-wheel

main-roseau:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs: main
uses: ./.github/workflows/roseau_check.yml
with:
module: main
module_id: anvillib

# ── Roseau summary comment ─────────────────────────────────────

roseau-summary:
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
needs:
- codec-roseau
- collision-roseau
- config-roseau
- font-roseau
- integration-roseau
- moveable-entity-block-roseau
- multiblock-roseau
- network-roseau
- recipe-roseau
- registrum-roseau
- rendering-roseau
- space-select-roseau
- sync-roseau
- util-roseau
- wheel-roseau
- main-roseau
if: always()
runs-on: ubuntu-latest
env:
CODEC_BC: ${{ needs.codec-roseau.outputs.has_bc }}
CODEC_N: ${{ needs.codec-roseau.outputs.bc_count }}
COLLISION_BC: ${{ needs.collision-roseau.outputs.has_bc }}
COLLISION_N: ${{ needs.collision-roseau.outputs.bc_count }}
CONFIG_BC: ${{ needs.config-roseau.outputs.has_bc }}
CONFIG_N: ${{ needs.config-roseau.outputs.bc_count }}
FONT_BC: ${{ needs.font-roseau.outputs.has_bc }}
FONT_N: ${{ needs.font-roseau.outputs.bc_count }}
INTEGRATION_BC: ${{ needs.integration-roseau.outputs.has_bc }}
INTEGRATION_N: ${{ needs.integration-roseau.outputs.bc_count }}
MEB_BC: ${{ needs.moveable-entity-block-roseau.outputs.has_bc }}
MEB_N: ${{ needs.moveable-entity-block-roseau.outputs.bc_count }}
MULTIBLOCK_BC: ${{ needs.multiblock-roseau.outputs.has_bc }}
MULTIBLOCK_N: ${{ needs.multiblock-roseau.outputs.bc_count }}
NETWORK_BC: ${{ needs.network-roseau.outputs.has_bc }}
NETWORK_N: ${{ needs.network-roseau.outputs.bc_count }}
RECIPE_BC: ${{ needs.recipe-roseau.outputs.has_bc }}
RECIPE_N: ${{ needs.recipe-roseau.outputs.bc_count }}
REGISTRUM_BC: ${{ needs.registrum-roseau.outputs.has_bc }}
REGISTRUM_N: ${{ needs.registrum-roseau.outputs.bc_count }}
RENDERING_BC: ${{ needs.rendering-roseau.outputs.has_bc }}
RENDERING_N: ${{ needs.rendering-roseau.outputs.bc_count }}
SPACESELECT_BC: ${{ needs.space-select-roseau.outputs.has_bc }}
SPACESELECT_N: ${{ needs.space-select-roseau.outputs.bc_count }}
SYNC_BC: ${{ needs.sync-roseau.outputs.has_bc }}
SYNC_N: ${{ needs.sync-roseau.outputs.bc_count }}
UTIL_BC: ${{ needs.util-roseau.outputs.has_bc }}
UTIL_N: ${{ needs.util-roseau.outputs.bc_count }}
WHEEL_BC: ${{ needs.wheel-roseau.outputs.has_bc }}
WHEEL_N: ${{ needs.wheel-roseau.outputs.bc_count }}
MAIN_BC: ${{ needs.main-roseau.outputs.has_bc }}
MAIN_N: ${{ needs.main-roseau.outputs.bc_count }}
steps:
- name: Generate and post PR comment
run: |
row() {
local name=$1 bc=$2 count=$3
if [ -z "$bc" ]; then
echo "| ${name} | ⚪ Skipped | — |"
elif [ "$bc" = "true" ]; then
echo "| ${name} | 🔴 BC detected | ${count} |"
else
echo "| ${name} | ✅ Compatible | 0 |"
fi
}

{
echo "## 🌿 Roseau API Breaking Change Report"
echo ""
echo "| Module | Status | Breaking Changes |"
echo "|--------|--------|-----------------|"
row "codec" "$CODEC_BC" "$CODEC_N"
row "collision" "$COLLISION_BC" "$COLLISION_N"
row "config" "$CONFIG_BC" "$CONFIG_N"
row "font" "$FONT_BC" "$FONT_N"
row "integration" "$INTEGRATION_BC" "$INTEGRATION_N"
row "moveable-entity-block" "$MEB_BC" "$MEB_N"
row "multiblock" "$MULTIBLOCK_BC" "$MULTIBLOCK_N"
row "network" "$NETWORK_BC" "$NETWORK_N"
row "recipe" "$RECIPE_BC" "$RECIPE_N"
row "registrum" "$REGISTRUM_BC" "$REGISTRUM_N"
row "rendering" "$RENDERING_BC" "$RENDERING_N"
row "space-select" "$SPACESELECT_BC" "$SPACESELECT_N"
row "sync" "$SYNC_BC" "$SYNC_N"
row "util" "$UTIL_BC" "$UTIL_N"
row "wheel" "$WHEEL_BC" "$WHEEL_N"
row "main" "$MAIN_BC" "$MAIN_N"
echo ""
echo "> Detailed reports: see the *Artifacts* section of [this workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})."
} > /tmp/roseau-body.md

- name: Find existing Roseau comment
id: find-comment
uses: peter-evans/find-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: github-actions[bot]
body-includes: Roseau API Breaking Change Report

- name: Create or update PR comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-path: /tmp/roseau-body.md
edit-mode: replace
75 changes: 75 additions & 0 deletions .github/workflows/roseau_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Roseau Check

on:
workflow_call:
inputs:
module:
description: 'Module directory name (e.g. codec, config)'
required: true
type: string
module_id:
description: 'Module short ID (e.g. anvillib-codec)'
required: true
type: string
outputs:
has_bc:
description: 'Whether breaking changes were detected'
value: ${{ jobs.check.outputs.has_bc }}
bc_count:
description: 'Number of breaking changes'
value: ${{ jobs.check.outputs.bc_count }}

jobs:
check:
runs-on: ubuntu-latest
outputs:
has_bc: ${{ steps.result.outputs.has_bc }}
bc_count: ${{ steps.result.outputs.bc_count }}
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Read Java version
id: properties
uses: christian-draeger/read-properties@1.1.1
with:
path: gradle.properties
properties: java_version

- name: Setup Java ${{ steps.properties.outputs.java_version }}
uses: actions/setup-java@v5.2.0
with:
distribution: zulu
java-version: ${{ steps.properties.outputs.java_version }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6

- name: Run roseauCheck
id: roseau
continue-on-error: true
run: ./gradlew :${{ inputs.module_id }}-neoforge-26.1:roseauCheck

- name: Collect result
id: result
if: always()
run: |
CSV="module.${{ inputs.module }}/build/reports/roseau/report.csv"
if [ -f "$CSV" ] && [ "$(wc -l < "$CSV")" -gt 1 ]; then
COUNT=$(($(wc -l < "$CSV") - 1))
echo "has_bc=true" >> $GITHUB_OUTPUT
echo "bc_count=${COUNT}" >> $GITHUB_OUTPUT
echo "Roseau: ${COUNT} breaking change(s) in ${{ inputs.module }}"
else
echo "has_bc=false" >> $GITHUB_OUTPUT
echo "bc_count=0" >> $GITHUB_OUTPUT
echo "Roseau: no breaking changes in ${{ inputs.module }}"
fi

- name: Upload report
if: always()
uses: actions/upload-artifact@v7
with:
name: roseau-${{ inputs.module }}
path: module.${{ inputs.module }}/build/reports/roseau/
retention-days: 7
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,7 @@ subprojects {
apply plugin: "me.modmuss50.mod-publish-plugin"

apply from: rootProject.file("module.gradle")
if (it.name != "anvillib-test-neoforge-26.1") {
apply from: rootProject.file("gradle/scripts/roseau.gradle")
}
}
Loading
Loading