run_benchmarks #75
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
name: Benchmarks | |
on: | |
pull_request: | |
types: | |
- closed | |
repository_dispatch: | |
types: [run_benchmarks] | |
schedule: | |
# Every night at 01:11 UTC | |
- cron: '11 1 * * *' | |
env: | |
DATA_PATH: /home/scalabenchs/bench-data-v3 | |
jobs: | |
benchmarks_merge: | |
name: Benchmarks (merge) | |
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true | |
runs-on: ['self-hosted', 'benchmarks'] | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Set path (temporary) | |
run: echo '/home/scalabenchs/.local/share/coursier/bin' >> $GITHUB_PATH | |
- name: Run benchmarks | |
# Select benchmarks that do not contain `Nightly` or `Bootstrapped` in their name. | |
# `-foe true` means "fail on error". | |
# `-gc true` launches the garbage collector between each iterations, which significantly reduces noise. | |
run: sbt 'scala3-bench / Jmh / run -foe true -gc true -e Nightly -e Bootstrapped' | tee jmh_output.txt | |
- name: Run bootstrapped benchmarks | |
# Select benchmarks that contain `Bootstrapped` in their name, but not `Nightly`. | |
run: sbt 'scala3-bench-bootstrapped / Jmh / run -foe true -gc true -e Nightly Bootstrapped' | tee -a jmh_output.txt | |
- name: Save benchmarks results | |
run: scala $DATA_PATH/scripts --main-class importResults -- ${{github.event.pull_request.number}} true | |
- name: Generate vizualizer data | |
run: scala $DATA_PATH/scripts --main-class makeVizualizerData -- $DATA_PATH | |
- name: Upload vizualizer data | |
run: rsync -av "$DATA_PATH/vizualizer/" w3dtbenc@tresorvm02:htdocs/v3 | |
benchmarks_manual: | |
name: Benchmarks (manual) | |
if: github.event_name == 'repository_dispatch' | |
runs-on: ['self-hosted', 'benchmarks'] | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
ref: ${{ github.event.client_payload.commit }} | |
repository: ${{ github.event.client_payload.repo }} | |
- name: Show payload | |
# The payload should contain the following fields: `pr`, `commit`, `repo`: | |
run: | | |
echo "PR: ${{ github.event.client_payload.pr }}" | |
echo "Commit: ${{ github.event.client_payload.commit }}" | |
echo "Repo: ${{ github.event.client_payload.repo }}" | |
- name: Set path (temporary) | |
run: echo '/home/scalabenchs/.local/share/coursier/bin' >> $GITHUB_PATH | |
- name: Run benchmarks | |
run: sbt 'scala3-bench / Jmh / run -foe true -gc true -e Bootstrapped' | tee jmh_output.txt | |
- name: Run bootstrapped benchmarks | |
run: sbt 'scala3-bench-bootstrapped / Jmh / run -foe true -gc true Bootstrapped' | tee -a jmh_output.txt | |
- name: Save benchmarks results | |
run: scala $DATA_PATH/scripts --main-class importResults -- ${{github.event.client_payload.pr}} false | |
- name: Generate vizualizer data | |
run: scala $DATA_PATH/scripts --main-class makeVizualizerData -- $DATA_PATH | |
- name: Upload Results | |
run: rsync -av "$DATA_PATH/vizualizer/" w3dtbenc@tresorvm02:htdocs/v3 | |
- name: Post Comment | |
if: github.event_name == 'issue_comment' | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const comment = `Benchmarks results ready.`; | |
await github.issues.createComment({ | |
issue_number: context.client_payload.pr, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: comment, | |
}); | |
benchmarks_nightly: | |
name: Benchmarks (nightly) | |
if: github.event_name == 'schedule' | |
runs-on: ['self-hosted', 'benchmarks'] | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Set Path | |
run: echo '/home/scalabenchs/.local/share/coursier/bin' >> $GITHUB_PATH | |
- name: Run Benchmarks | |
run: sbt 'scala3-bench / Jmh / run -foe true -gc true -e Bootstrapped Nightly' | tee jmh_output.txt | |
- name: Save benchmarks results | |
run: scala $DATA_PATH/scripts --main-class importResults -- 0 true | |
- name: Generate vizualizer data | |
run: scala $DATA_PATH/scripts --main-class makeVizualizerData -- $DATA_PATH | |
- name: Upload Results | |
run: rsync -av "$DATA_PATH/vizualizer/" w3dtbenc@tresorvm02:htdocs/v3 |