mmtk 0.32.0

MMTk is a framework for the design and implementation of high-performance and portable memory managers.
Documentation
name: Binding Perf Tests (Micro Benchmarks)

# on:
#   pull_request:
#     types: [opened, synchronize, reopened, labeled]
#     branches:
#       - master

# Ignore micro benchmarks - micro benchmarking does not seem to be very helpful.
# We should rethink if we really need it or make it more useful.
on:
  push:
    branches-ignore:
      - '**'

concurrency:
  # Cancels pending runs when a PR gets updated.
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  openjdk-microbm:
    runs-on: [self-hosted, Linux, freq-scaling-off]
    if: contains(github.event.pull_request.labels.*.name, 'PR-benchmarking')
    steps:
      - name: Check Revisions
        uses: qinsoon/comment-env-vars@1.1.0
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          # TODO: If we plan to resurrect micro-bm, we need to get the trunk name from a unique .yml
          # file so that all GitHub Actions scripts agree upon which branch is the trunk (e.g.
          # jdk-11, jdk-21, ...).
          default_env: 'OPENJDK_BINDING_TRUNK_REF=master,MMTK_CORE_TRUNK_REF=master,OPENJDK_BINDING_BRANCH_REF=master,MMTK_CORE_BRANCH_REF=${{ github.event.pull_request.head.sha }}'
      # Trunk
      # - binding
      - name: Checkout OpenJDK Binding Trunk
        uses: actions/checkout@v4
        with:
          repository: mmtk/mmtk-openjdk
          token: ${{ secrets.GITHUB_TOKEN }}
          path: mmtk-openjdk-trunk
          submodules: true
          ref: ${{ env.OPENJDK_BINDING_TRUNK_REF }}
      # -core
      - name: Checkout MMTk Core
        uses: actions/checkout@v4
        with:
          ref: ${{ env.MMTK_CORE_TRUNK_REF }}
          path: mmtk-core-trunk
      # Branch
      # - binding
      - name: Checkout OpenJDK Binding Branch
        uses: actions/checkout@v4
        with:
          repository: mmtk/mmtk-openjdk
          token: ${{ secrets.GITHUB_TOKEN }}
          path: mmtk-openjdk-branch
          submodules: true
          ref: ${{ env.OPENJDK_BINDING_BRANCH_REF }}
      # - core
      - name: Checkout MMTk Core
        uses: actions/checkout@v4
        with:
          ref: ${{ env.MMTK_CORE_BRANCH_REF }}
          path: mmtk-core-branch
      # checkout perf-kit
      - name: Checkout Perf Kit
        uses: actions/checkout@v4
        with:
          repository: mmtk/ci-perf-kit
          token: ${{ secrets.GITHUB_TOKEN }}
          ref: "0.8.6"
          path: ci-perf-kit
          submodules: true
      # Use rust-toolchain in the trunk (it doesnt matter much - if the toolchains defined in the trunk and the branch are different, we cant run anyway)
      - name: Setup Rust Toolchain
        run: echo "RUSTUP_TOOLCHAIN=`cat mmtk-core-trunk/rust-toolchain`" >> $GITHUB_ENV
      # run compare
      - name: Compare Performance
        id: run
        run: |
          ./ci-perf-kit/scripts/openjdk-micro-bm.sh mmtk-openjdk-trunk/ mmtk-core-trunk/ mmtk-openjdk-branch/ mmtk-core-branch/ openjdk-rebench-report.md
      # set report.md to output
      - uses: pCYSl5EDgo/cat@master
        id: cat
        with:
          path: openjdk-rebench-report.md
      # upload run results
      - uses: actions/upload-artifact@v4
        with:
          name: openjdk-rebench-data
          path: ci-perf-kit/microbm/ci.data
      - uses: actions/upload-artifact@v4
        with:
          name: openjdk-rebench-report.md
          path: openjdk-rebench-report.md
      # report
      - name: Result
        if: always()
        uses: thollander/actions-comment-pull-request@main
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          message: ${{ steps.cat.outputs.text }}
      # Cleanup logs (this is necessary for self-hosted runners)
      - name: Clean up logs and reports
        if: always()
        run: |
          rm -f ci-perf-kit/microbm/*.data
          rm openjdk-rebench-report.md