-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge ModLauncher into FML repository
- Loading branch information
Showing
83 changed files
with
6,145 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import groovy.json.JsonSlurper | ||
import net.steppschuh.markdowngenerator.table.Table | ||
|
||
import java.nio.file.Files | ||
import java.nio.file.Path | ||
|
||
@GrabResolver(name='jitpack.io', root='https://jitpack.io/') | ||
@GrabResolver(name = 'central', root='https://repo1.maven.org/maven2/') | ||
@Grapes([ | ||
@Grab('org.apache.groovy:groovy-json:4.0.13'), | ||
@Grab('com.github.Steppschuh:Java-Markdown-Generator:1.3.2') | ||
]) | ||
|
||
final dummyClassResults = [:] | ||
final noopResults = [:] | ||
|
||
final resultsPath = Path.of('jmh_results') | ||
Files.list(resultsPath).map { it.resolve('result.json') } | ||
.map { [new JsonSlurper().parse(it.toFile()), it.parent.fileName.toString().substring('jmh_'.length())] } | ||
.forEach { | ||
dummyClassResults[it[1]] = "${it[0][0].primaryMetric.score.round(2)} ± ${it[0][0].primaryMetric.scoreError.round(2)} ${it[0][0].primaryMetric.scoreUnit}" | ||
noopResults[it[1]] = "${it[0][1].primaryMetric.score.round(2)} ± ${it[0][1].primaryMetric.scoreError.round(2)} ${it[0][1].primaryMetric.scoreUnit}" | ||
} | ||
|
||
Table.Builder dummyClassTable = new Table.Builder() | ||
.withAlignments(Table.ALIGN_RIGHT, Table.ALIGN_RIGHT) | ||
.addRow('JDK name & Version', 'Benchmark results') | ||
dummyClassResults.sort { a, b -> a.value <=> b.value }.forEach { type, results -> dummyClassTable.addRow(type, results) } | ||
|
||
Table.Builder noopTable = new Table.Builder() | ||
.withAlignments(Table.ALIGN_RIGHT, Table.ALIGN_RIGHT) | ||
.addRow('JDK name & Version', 'Benchmark results') | ||
noopResults.sort { a, b -> a.value <=> b.value }.forEach { type, results -> noopTable.addRow(type, results) } | ||
|
||
new File('jmh_results.md').text = """ | ||
# `cpw.mods.modlauncher.benchmarks.TransformBenchmark.transformDummyClass` results | ||
${dummyClassTable.build()} | ||
# `cpw.mods.modlauncher.benchmarks.TransformBenchmark.transformNoop` results | ||
${noopTable.build()} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Test JVMs and publish Jmh results | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
testjdks: | ||
name: Test JDK ${{ matrix.jdk }} version ${{ matrix.jvm_version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 10 | ||
fail-fast: false | ||
matrix: | ||
jvm_version: [ 21, 22 ] | ||
jdk: [ Graal_VM, Adoptium, Azul, Oracle, Amazon, BellSoft, SAP ] | ||
include: | ||
- jdk: IBM | ||
jvm_version: 21 # IBM only has 21 | ||
- jdk: Microsoft | ||
jvm_version: 21 # MS OpenJDK only has 21 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@main | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
cache-disabled: true | ||
generate-job-summary: false | ||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
- name: Run Jmh with Gradle Wrapper | ||
run: ./gradlew :jmh -PjmhVendor=${{ matrix.jdk }} -PjmhVersion=${{ matrix.jvm_version }} | ||
- uses: actions/upload-artifact@v3 | ||
name: Upload Results | ||
with: | ||
name: jmh_${{ matrix.jdk }}-${{ matrix.jvm_version }} | ||
path: build/reports/jmh/result.json | ||
|
||
upload_results: | ||
name: Upload Jmh results | ||
needs: [testjdks] | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} | ||
steps: | ||
- name: Setup Groovy | ||
uses: wtfjoke/setup-groovy@v1 | ||
with: | ||
groovy-version: '4.x' | ||
- name: Checkout repository | ||
uses: actions/checkout@main | ||
- name: Downloads results | ||
uses: actions/download-artifact@v3 | ||
id: download | ||
with: | ||
path: jmh_results | ||
- name: Collect results | ||
run: groovy .github/workflows/collect_jmh_results.groovy | ||
- name: Upload Final Results | ||
run: cat jmh_results.md >> $GITHUB_STEP_SUMMARY |
Oops, something went wrong.