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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true

[*.java]
charset = utf-8
indent_style = tab
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
max_line_length = 120

[*.md]
trim_trailing_whitespace = false

[*.{json,toml,properties,yml}]
indent_size = 2
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,3 @@ src/generated/**/*.json text eol=lf
*.md text eol=lf
/gradlew text eol=lf
/gradlew.bat text eol=lf

# Keep the original whitespace in checksum-verified patch files.
/ci-fixtures/tools/*.patch whitespace=-blank-at-eol,-blank-at-eof
165 changes: 38 additions & 127 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,158 +1,69 @@
name: Base Metals 1.19.4 CI
name: Base Metals CI

on:
push:
branches:
- master-1.19.4
- 'master-1.21.1-neo'
- 'feature/**'
pull_request:
branches:
- master-1.19.4
- 'master-1.21.1-neo'

env:
JAVA_VERSION: '21'

permissions:
contents: read
checks: write
pull-requests: write

concurrency:
group: basemetals-1.19.4-${{ github.workflow }}-${{ github.ref }}
group: basemetals-ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build, test, and audit
name: Build & Test
runs-on: ubuntu-latest
timeout-minutes: 90
timeout-minutes: 20

steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Checkout code
uses: actions/checkout@v4

- name: Install pinned Java 17 runtime and toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17.0.1+12'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6

- name: Stage exact OreSpawn release dependency
id: orespawn
run: |
mirror="$RUNNER_TEMP/orespawn-mirror"
bash gradle/stage-orespawn-release.sh "$mirror"
echo "repository=$mirror" >> "$GITHUB_OUTPUT"

- name: Build, test, and audit first candidate
run: |
chmod +x ./gradlew
./gradlew clean check build javadoc verifyReleaseArtifacts writeReleaseChecksums \
-PorespawnVerificationRepository="${{ steps.orespawn.outputs.repository }}" \
--no-daemon --stacktrace
first="$RUNNER_TEMP/basemetals-first"
mkdir -p "$first"
cp build/libs/BaseMetals-3.1.0.119041.jar "$first/"
cp build/libs/BaseMetals-3.1.0.119041-sources.jar "$first/"
cp build/libs/BaseMetals-3.1.0.119041-javadoc.jar "$first/"
cp build/release/SHA256SUMS "$first/"

- name: Rebuild and prove byte-identical archives
run: |
./gradlew clean assemble verifyReleaseArtifacts writeReleaseChecksums \
-PorespawnVerificationRepository="${{ steps.orespawn.outputs.repository }}" \
--no-daemon --stacktrace
cmp "$RUNNER_TEMP/basemetals-first/BaseMetals-3.1.0.119041.jar" build/libs/BaseMetals-3.1.0.119041.jar
cmp "$RUNNER_TEMP/basemetals-first/BaseMetals-3.1.0.119041-sources.jar" build/libs/BaseMetals-3.1.0.119041-sources.jar
cmp "$RUNNER_TEMP/basemetals-first/BaseMetals-3.1.0.119041-javadoc.jar" build/libs/BaseMetals-3.1.0.119041-javadoc.jar
cmp "$RUNNER_TEMP/basemetals-first/SHA256SUMS" build/release/SHA256SUMS
java-version: ${{ env.JAVA_VERSION }}
distribution: 'microsoft'

- name: Run all required GameTests
run: >-
timeout 15m ./gradlew runGameTestServer
-PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }}
--no-daemon --stacktrace
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Install official Forge packaged runtimes
id: forge-runtimes
run: |
server_runtime="$RUNNER_TEMP/forge-1.19.4-45.4.0-server"
client_runtime="$RUNNER_TEMP/forge-1.19.4-45.4.0-client"
installer="$RUNNER_TEMP/forge-1.19.4-45.4.0-installer.jar"
mkdir -p "$server_runtime" "$client_runtime"
curl --fail --location --retry 3 \
--output "$installer" \
https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.4.0/forge-1.19.4-45.4.0-installer.jar
echo "6643bb8c21f409cc528ff656daf60c206d304cc77bf529bbbab4b336004dfc53 $installer" | sha256sum --check --strict
(
cd "$server_runtime"
java -jar "$installer" --installServer
)
python3 gradle/prepare-forge-client-runtime.py \
--installer "$installer" \
--runtime "$client_runtime" \
--java "$JAVA_HOME/bin/java"
echo "server_runtime=$server_runtime" >> "$GITHUB_OUTPUT"
echo "client_runtime=$client_runtime" >> "$GITHUB_OUTPUT"
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Run exact packaged dedicated-server smoke
run: >-
timeout 15m ./gradlew packagedServerStartupSmoke
-PpackagedForgeServerRuntime=${{ steps.forge-runtimes.outputs.server_runtime }}
-PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }}
--no-daemon --stacktrace
- name: Build with Gradle
env:
BUILD_NUMBER: ${{ github.run_number }}
run: ./gradlew assemble

- name: Run exact packaged integrated-world client smoke
run: >-
timeout 15m xvfb-run -a ./gradlew packagedClientStartupSmoke
-PpackagedForgeClientRuntime=${{ steps.forge-runtimes.outputs.client_runtime }}
-PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }}
--no-daemon --stacktrace
- name: Run tests
run: ./gradlew check

- name: Run bounded development integrated-world client smoke
run: >-
timeout 15m xvfb-run -a ./gradlew runClient
-PintegratedWorldSmoke=true
-PintegratedWorldSmokeName=basemetals-ci-${{ github.run_id }}
-PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }}
--no-daemon --stacktrace

- name: Generate and audit Eclipse production launches
run: >-
./gradlew genEclipseRuns eclipse isolateEclipseProductionRuns verifyEclipseProductionClasspath
-PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }}
--no-daemon --stacktrace

- name: Upload audited release candidate
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure()
with:
name: BaseMetals-1.19.4-${{ github.sha }}
if-no-files-found: error
retention-days: 30
path: |
build/libs/BaseMetals-3.1.0.119041.jar
build/libs/BaseMetals-3.1.0.119041-sources.jar
build/libs/BaseMetals-3.1.0.119041-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.txt
report_paths: '**/build/test-results/test/TEST-*.xml'

- name: Upload bounded diagnostics on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
- name: Upload build artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: BaseMetals-1.19.4-diagnostics-${{ github.sha }}
if-no-files-found: ignore
name: ${{ github.event.repository.name }}-${{ github.sha }}
if-no-files-found: error
retention-days: 14
path: |
build/test-results/**
build/reports/**
run/logs/**
run/crash-reports/**
run-gametest/logs/**
run-gametest/crash-reports/**
run-integrated-smoke/logs/**
run-integrated-smoke/crash-reports/**
run-data/logs/**
build/problems/**
build/packaged-server-run/logs/**
build/packaged-server-run/crash-reports/**
build/packaged-client-run/logs/**
build/packaged-client-run/crash-reports/**
build/libs/*.jar
CHANGELOG.md
33 changes: 12 additions & 21 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: CodeQL
on:
push:
branches:
- master-1.19.4
- 'master-1.21.1-neo'
- 'feature/**'
pull_request:
branches:
- master-1.19.4
- 'master-1.21.1-neo'

permissions:
actions: read
Expand All @@ -18,39 +18,30 @@ jobs:
analyze:
name: Analyze Java
runs-on: ubuntu-latest
timeout-minutes: 45
timeout-minutes: 30

steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
uses: actions/checkout@v4

- name: Install pinned Java 17 runtime and toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
- name: Install Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17.0.1+12'
distribution: 'microsoft'
java-version: '21'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6

- name: Stage exact OreSpawn release dependency
id: orespawn
run: |
mirror="$RUNNER_TEMP/orespawn-mirror"
bash gradle/stage-orespawn-release.sh "$mirror"
echo "repository=$mirror" >> "$GITHUB_OUTPUT"
uses: gradle/actions/setup-gradle@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
uses: github/codeql-action/init@v3
with:
languages: java-kotlin

- name: Compile production code
run: |
chmod +x ./gradlew
./gradlew clean classes --rerun-tasks --no-build-cache \
-PorespawnVerificationRepository="${{ steps.orespawn.outputs.repository }}" \
--no-daemon --stacktrace
./gradlew clean classes --no-daemon

- name: Analyze
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
uses: github/codeql-action/analyze@v3
Loading
Loading