|
1 | | -name: Base Metals 1.19.4 CI |
| 1 | +name: Base Metals CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: |
6 | | - - master-1.19.4 |
| 6 | + - 'master-1.21.1-neo' |
7 | 7 | - 'feature/**' |
8 | 8 | pull_request: |
9 | 9 | branches: |
10 | | - - master-1.19.4 |
| 10 | + - 'master-1.21.1-neo' |
| 11 | + |
| 12 | +env: |
| 13 | + JAVA_VERSION: '21' |
11 | 14 |
|
12 | 15 | permissions: |
13 | 16 | contents: read |
| 17 | + checks: write |
| 18 | + pull-requests: write |
14 | 19 |
|
15 | 20 | concurrency: |
16 | | - group: basemetals-1.19.4-${{ github.workflow }}-${{ github.ref }} |
| 21 | + group: basemetals-ci-${{ github.ref }} |
17 | 22 | cancel-in-progress: true |
18 | 23 |
|
19 | 24 | jobs: |
20 | 25 | build: |
21 | | - name: Build, test, and audit |
| 26 | + name: Build & Test |
22 | 27 | runs-on: ubuntu-latest |
23 | | - timeout-minutes: 90 |
| 28 | + timeout-minutes: 20 |
24 | 29 |
|
25 | 30 | steps: |
26 | | - - name: Check out source |
27 | | - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 31 | + - name: Checkout code |
| 32 | + uses: actions/checkout@v4 |
28 | 33 |
|
29 | | - - name: Install pinned Java 17 runtime and toolchain |
30 | | - uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5 |
| 34 | + - name: Set up JDK ${{ env.JAVA_VERSION }} |
| 35 | + uses: actions/setup-java@v4 |
31 | 36 | with: |
32 | | - distribution: temurin |
33 | | - java-version: '17.0.1+12' |
34 | | - |
35 | | - - name: Set up Gradle |
36 | | - uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6 |
37 | | - |
38 | | - - name: Stage exact OreSpawn release dependency |
39 | | - id: orespawn |
40 | | - run: | |
41 | | - mirror="$RUNNER_TEMP/orespawn-mirror" |
42 | | - bash gradle/stage-orespawn-release.sh "$mirror" |
43 | | - echo "repository=$mirror" >> "$GITHUB_OUTPUT" |
44 | | -
|
45 | | - - name: Build, test, and audit first candidate |
46 | | - run: | |
47 | | - chmod +x ./gradlew |
48 | | - ./gradlew clean check build javadoc verifyReleaseArtifacts writeReleaseChecksums \ |
49 | | - -PorespawnVerificationRepository="${{ steps.orespawn.outputs.repository }}" \ |
50 | | - --no-daemon --stacktrace |
51 | | - first="$RUNNER_TEMP/basemetals-first" |
52 | | - mkdir -p "$first" |
53 | | - cp build/libs/BaseMetals-3.1.0.119041.jar "$first/" |
54 | | - cp build/libs/BaseMetals-3.1.0.119041-sources.jar "$first/" |
55 | | - cp build/libs/BaseMetals-3.1.0.119041-javadoc.jar "$first/" |
56 | | - cp build/release/SHA256SUMS "$first/" |
57 | | -
|
58 | | - - name: Rebuild and prove byte-identical archives |
59 | | - run: | |
60 | | - ./gradlew clean assemble verifyReleaseArtifacts writeReleaseChecksums \ |
61 | | - -PorespawnVerificationRepository="${{ steps.orespawn.outputs.repository }}" \ |
62 | | - --no-daemon --stacktrace |
63 | | - cmp "$RUNNER_TEMP/basemetals-first/BaseMetals-3.1.0.119041.jar" build/libs/BaseMetals-3.1.0.119041.jar |
64 | | - cmp "$RUNNER_TEMP/basemetals-first/BaseMetals-3.1.0.119041-sources.jar" build/libs/BaseMetals-3.1.0.119041-sources.jar |
65 | | - cmp "$RUNNER_TEMP/basemetals-first/BaseMetals-3.1.0.119041-javadoc.jar" build/libs/BaseMetals-3.1.0.119041-javadoc.jar |
66 | | - cmp "$RUNNER_TEMP/basemetals-first/SHA256SUMS" build/release/SHA256SUMS |
| 37 | + java-version: ${{ env.JAVA_VERSION }} |
| 38 | + distribution: 'microsoft' |
67 | 39 |
|
68 | | - - name: Run all required GameTests |
69 | | - run: >- |
70 | | - timeout 15m ./gradlew runGameTestServer |
71 | | - -PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }} |
72 | | - --no-daemon --stacktrace |
| 40 | + - name: Setup Gradle |
| 41 | + uses: gradle/actions/setup-gradle@v4 |
73 | 42 |
|
74 | | - - name: Install official Forge packaged runtimes |
75 | | - id: forge-runtimes |
76 | | - run: | |
77 | | - server_runtime="$RUNNER_TEMP/forge-1.19.4-45.4.0-server" |
78 | | - client_runtime="$RUNNER_TEMP/forge-1.19.4-45.4.0-client" |
79 | | - installer="$RUNNER_TEMP/forge-1.19.4-45.4.0-installer.jar" |
80 | | - mkdir -p "$server_runtime" "$client_runtime" |
81 | | - curl --fail --location --retry 3 \ |
82 | | - --output "$installer" \ |
83 | | - https://maven.minecraftforge.net/net/minecraftforge/forge/1.19.4-45.4.0/forge-1.19.4-45.4.0-installer.jar |
84 | | - echo "6643bb8c21f409cc528ff656daf60c206d304cc77bf529bbbab4b336004dfc53 $installer" | sha256sum --check --strict |
85 | | - ( |
86 | | - cd "$server_runtime" |
87 | | - java -jar "$installer" --installServer |
88 | | - ) |
89 | | - python3 gradle/prepare-forge-client-runtime.py \ |
90 | | - --installer "$installer" \ |
91 | | - --runtime "$client_runtime" \ |
92 | | - --java "$JAVA_HOME/bin/java" |
93 | | - echo "server_runtime=$server_runtime" >> "$GITHUB_OUTPUT" |
94 | | - echo "client_runtime=$client_runtime" >> "$GITHUB_OUTPUT" |
| 43 | + - name: Grant execute permission for gradlew |
| 44 | + run: chmod +x ./gradlew |
95 | 45 |
|
96 | | - - name: Run exact packaged dedicated-server smoke |
97 | | - run: >- |
98 | | - timeout 15m ./gradlew packagedServerStartupSmoke |
99 | | - -PpackagedForgeServerRuntime=${{ steps.forge-runtimes.outputs.server_runtime }} |
100 | | - -PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }} |
101 | | - --no-daemon --stacktrace |
| 46 | + - name: Build with Gradle |
| 47 | + env: |
| 48 | + BUILD_NUMBER: ${{ github.run_number }} |
| 49 | + run: ./gradlew assemble |
102 | 50 |
|
103 | | - - name: Run exact packaged integrated-world client smoke |
104 | | - run: >- |
105 | | - timeout 15m xvfb-run -a ./gradlew packagedClientStartupSmoke |
106 | | - -PpackagedForgeClientRuntime=${{ steps.forge-runtimes.outputs.client_runtime }} |
107 | | - -PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }} |
108 | | - --no-daemon --stacktrace |
| 51 | + - name: Run tests |
| 52 | + run: ./gradlew check |
109 | 53 |
|
110 | | - - name: Run bounded development integrated-world client smoke |
111 | | - run: >- |
112 | | - timeout 15m xvfb-run -a ./gradlew runClient |
113 | | - -PintegratedWorldSmoke=true |
114 | | - -PintegratedWorldSmokeName=basemetals-ci-${{ github.run_id }} |
115 | | - -PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }} |
116 | | - --no-daemon --stacktrace |
117 | | -
|
118 | | - - name: Generate and audit Eclipse production launches |
119 | | - run: >- |
120 | | - ./gradlew genEclipseRuns eclipse isolateEclipseProductionRuns verifyEclipseProductionClasspath |
121 | | - -PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }} |
122 | | - --no-daemon --stacktrace |
123 | | -
|
124 | | - - name: Upload audited release candidate |
125 | | - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 |
| 54 | + - name: Publish Test Report |
| 55 | + uses: mikepenz/action-junit-report@v4 |
| 56 | + if: success() || failure() |
126 | 57 | with: |
127 | | - name: BaseMetals-1.19.4-${{ github.sha }} |
128 | | - if-no-files-found: error |
129 | | - retention-days: 30 |
130 | | - path: | |
131 | | - build/libs/BaseMetals-3.1.0.119041.jar |
132 | | - build/libs/BaseMetals-3.1.0.119041-sources.jar |
133 | | - build/libs/BaseMetals-3.1.0.119041-javadoc.jar |
134 | | - build/release/SHA256SUMS |
135 | | - CHANGELOG.txt |
| 58 | + report_paths: '**/build/test-results/test/TEST-*.xml' |
136 | 59 |
|
137 | | - - name: Upload bounded diagnostics on failure |
138 | | - if: failure() |
139 | | - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 |
| 60 | + - name: Upload build artifacts |
| 61 | + if: success() |
| 62 | + uses: actions/upload-artifact@v4 |
140 | 63 | with: |
141 | | - name: BaseMetals-1.19.4-diagnostics-${{ github.sha }} |
142 | | - if-no-files-found: ignore |
| 64 | + name: ${{ github.event.repository.name }}-${{ github.sha }} |
| 65 | + if-no-files-found: error |
143 | 66 | retention-days: 14 |
144 | 67 | path: | |
145 | | - build/test-results/** |
146 | | - build/reports/** |
147 | | - run/logs/** |
148 | | - run/crash-reports/** |
149 | | - run-gametest/logs/** |
150 | | - run-gametest/crash-reports/** |
151 | | - run-integrated-smoke/logs/** |
152 | | - run-integrated-smoke/crash-reports/** |
153 | | - run-data/logs/** |
154 | | - build/problems/** |
155 | | - build/packaged-server-run/logs/** |
156 | | - build/packaged-server-run/crash-reports/** |
157 | | - build/packaged-client-run/logs/** |
158 | | - build/packaged-client-run/crash-reports/** |
| 68 | + build/libs/*.jar |
| 69 | + CHANGELOG.md |
0 commit comments