Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmark CI #2368

Closed
wants to merge 10 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 24 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,53 +209,38 @@ jobs:
id: push_codecov
run: 'bash <(curl -s https://codecov.io/bash)'

Jmh_publish:
name: Jmh Publish
if: ${{ github.event.label.name == 'run jmh' && github.event_name == 'pull_request' }}
benchmark:
name: JMH Benchmarks
permissions:
contents: write
pull-requests: write
issues: write
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.13.10]
java: [temurin@8]
runs-on: ${{ matrix.os }}
steps:
- name: Format Output
id: fomat_output
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Java (temurin@8)
if: matrix.java == 'temurin@8'
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: sbt
- name: Build and run JMH benchmark
run: |
cat parsed_Current.txt parsed_Main.txt | sort -u > c.txt
while IFS= read -r line; do
if grep -q "$line" Current.txt
then
grep "$line" Current.txt | sed 's/^.*: //' >> finalCurrent.txt;
else
echo "" >> finalCurrent.txt;
fi
if grep -q "$line" Main.txt
then
grep "$line" Main.txt | sed 's/^.*: //' >> finalMain.txt;
else
echo "" >> finalMain.txt;
fi
done < c.txt
paste -d '|' c.txt finalCurrent.txt finalMain.txt > FinalOutput.txt
sed -i -e 's/^/|/' FinalOutput.txt
sed -i -e 's/$/|/' FinalOutput.txt
body=$(cat FinalOutput.txt)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo $body
echo ::set-output name=body::$(echo $body)


- uses: peter-evans/commit-comment@v1
sbt ++${{ matrix.scala }} 'zioHttpBenchmarks/jmh:run -i 1 -wi 0 -f1 -t1 -rf json -rff output.json HttpCombineEval.ok'
- name: JMH Benchmark Action
uses: kitlangton/jmh-benchmark-action@main
with:
sha: ${{github.sha}}
body: |
jmh-output-path: zio-http-benchmarks/output.json
github-token: ${{ secrets.GITHUB_TOKEN }}
fail-on-regression: true

**🚀 Jmh Benchmark:**

|Name |Current| Main|
|-----|----| ----|
${{steps.fomat_output.outputs.body}}

Loading