Skip to content

Commit

Permalink
Remove benchmarks, simplify CI
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Jul 15, 2024
1 parent 33e1c15 commit 02b8582
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10,101 deletions.
92 changes: 0 additions & 92 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,98 +26,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

benchmark:
needs: [ ci ]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
cache: 'maven'
- name: Run java benchmarks
id: benchmark_java
run: |
mvn package -DskipTests=true
java -Djmh.executor=VIRTUAL -jar bench/bench-java/target/benchmarks.jar -i 5 -wi 5 -f 1 -to 1100ms -r 1000ms -w 1000ms -rf json -rff jmh-result-java.json | tee out.txt
echo 'output<<EOF' >> $GITHUB_OUTPUT
cat out.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Run kotlin benchmarks
id: benchmark_kotlin
run: |
java -jar bench/bench-kotlin/target/benchmarks.jar -i 5 -wi 5 -f 1 -to 1100ms -r 1000ms -w 1000ms -rf json -rff jmh-result-kotlin.json | tee out.txt
echo 'output<<EOF' >> $GITHUB_OUTPUT
cat out.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Merge java and kotlin benchmark results
run: jq -s '.[0] + .[1]' jmh-result-java.json jmh-result-kotlin.json > jmh-result-all.json
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Check & store benchmark result
uses: benchmark-action/github-action-benchmark@v1
# Only store updated benchmark results on main branch
if: steps.extract_branch.outputs.branch == 'main'
with:
tool: 'jmh'
output-file-path: jmh-result-all.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '120%'
# Enable alert commit comment
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@adamw'
# Store benchmark results in the docs folder of the main branch
gh-pages-branch: ${{ steps.extract_branch.outputs.branch }}
benchmark-data-dir-path: 'docs/bench'
skip-fetch-gh-pages: true
- name: Comment on PR with results
uses: actions/github-script@v7
env:
JAVA_OUTPUT: ${{ steps.benchmark_java.outputs.output }}
KOTLIN_OUTPUT: ${{ steps.benchmark_kotlin.outputs.output }}
with:
script: |
function extractContent(str) {
const regex = /^Benchmark([\s\S]*?)(?=^Benchmark result)/m;
const match = str.match(regex);
return match ? match[1].trim() : null;
}
// Only if there's a PR within which we run
if (context.issue.number) {
let javaResults = extractContent(`${process.env.JAVA_OUTPUT}`);
let kotlinResults = extractContent(`${process.env.KOTLIN_OUTPUT}`);
let comment = `<details><summary>Benchmark results</summary>
\`\`\`
Java:
${javaResults}
Kotlin:
${kotlinResults}
\`\`\`
</details>`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
}
publishReleaseNotes:
name: Publish release notes
needs: [ ci ]
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.idea
target
*.iml


# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
Expand Down
Loading

0 comments on commit 02b8582

Please sign in to comment.