diff --git a/.github/workflows/profile.yml b/.github/workflows/profile.yml index 2fb39ddbe..c8d7c7d6e 100644 --- a/.github/workflows/profile.yml +++ b/.github/workflows/profile.yml @@ -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 @@ -26,6 +26,8 @@ jobs: distribution: temurin java-version: 17 check-latest: true + - uses: coursier/cache-action@v6 + - uses: VirtusLab/scala-cli-setup@main - name: Use CI sbt jvmopts shell: bash run: | @@ -57,22 +59,35 @@ 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) + echo "Store flame graphs" + echo "Collecting new flame graph" + 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="
  • $COMMIT_DATE $COMMIT_TIME Flame graphs for $REV $COMMIT_MSG
  • " + echo "::group::Content of zio-kafka-bench directory" ls -al zio-kafka-bench/ + echo "::endgroup::" mv zio-kafka-bench/zio.kafka.bench.* /tmp + echo "::group::Checkout gh-pages branch" git clean -fdx git checkout gh-pages git pull + git config --global user.name "zio-kafka CI" + git config --global user.email "ziokafkaci@users.noreply.github.com" + echo "::endgroup::" + echo "Remove old flame graphs" + scala-cli scripts/prune-flame-graph.sc + echo "::group::Adding new flame graph" mkdir -p dev/profile/$REV 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 push \ No newline at end of file + git commit -m "Flame graphs for $REV" + git push + echo "::endgroup::" diff --git a/.gitignore b/.gitignore index ee9014b9b..3a8991a4a 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,6 @@ project/plugins/project/ # MacOS .DS_Store + +#scala-cli +.scala-build/