diff --git a/.github/workflows/kt-bench.yml b/.github/workflows/kt-bench.yml new file mode 100644 index 00000000..63e3f3d4 --- /dev/null +++ b/.github/workflows/kt-bench.yml @@ -0,0 +1,110 @@ +name: Kotlin benchmarks + +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + get-inputs: + uses: ephemient/aoc2023/.github/workflows/get-inputs.yml@main + secrets: + SESSION: ${{ secrets.SESSION }} + + jmh-visualizer: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + repository: jzillmann/jmh-visualizer + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - run: npm install + - run: npm run providedZip + env: + NODE_OPTIONS: --openssl-legacy-provider + - uses: actions/upload-artifact@v3 + with: + name: jmh-visualizer + path: jmh-visualizer.zip + + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - uses: gradle/gradle-build-action@v2 + with: + arguments: assembleBenchmarks + build-root-directory: kt + - uses: actions/upload-artifact@v3 + with: + name: jvmBench + path: kt/aoc2023-exe/build/benchmarks/*/jars/*.jar + + run: + needs: [ get-inputs, jmh-visualizer, build ] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + ref: gh-docs + - uses: actions/download-artifact@v3 + with: + name: inputs + path: inputs + - uses: actions/download-artifact@v3 + with: + name: jmh-visualizer + - uses: actions/download-artifact@v3 + with: + name: jvmBench + - run: rm -rf jmh-visualizer + - run: unzip -d jmh-visualizer jmh-visualizer.zip + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - name: Run JVM benchmarks + run: | + cat >config <jmh-visualizer/provided.js <