Skip to content

Commit

Permalink
Automatically add new flame graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvanoosten committed Nov 12, 2023
1 parent 631e1b0 commit e319097
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }} # comes from https://github.com/orgs/community/discussions/25217#discussioncomment-3246904
steps:
- uses: actions/checkout@v3.0.2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
Expand Down Expand Up @@ -57,10 +57,12 @@ jobs:
mv .jvmopts_old .jvmopts
cat .jvmopts
- name: Store flamegraphs
- name: Store flame graphs
run: |
git config pull.rebase true
export REV=$(git rev-parse --short HEAD)
git config pull.rebase true
read REV COMMIT_DATE COMMIT_TIME COMMIT_TZ COMMIT_MSG <<< \
$(git log --pretty=format:'%h %ad %s' --date=iso8601 -n 1 ${{ github.event.pull_request.head.sha }})
HTML_LINE=" <li>$COMMIT_DATE $COMMIT_TIME <a href=\"$REV\">Flame graphs for $REV</a> $COMMIT_MSG</li>"
ls -al zio-kafka-bench/
mv zio-kafka-bench/zio.kafka.bench.* /tmp
git clean -fdx
Expand All @@ -70,9 +72,10 @@ jobs:
mv /tmp/zio.kafka.bench.* dev/profile/$REV
cd dev/profile
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && tree -H . -o index.html" \;
sed -i'' -e '/NEW-FLAME-GRAPHS-GO-HERE/a\'$'\n'"$HTML_LINE"$'\n' index.html
cd ../../
git config --global user.name "zio-kafka CI"
git config --global user.email "ziokafkaci@users.noreply.github.com"
git add .
git commit -m "flamegraphs for $REV"
git commit -m "Flame graphs for $REV"
git push

0 comments on commit e319097

Please sign in to comment.