@@ -49,10 +49,12 @@ jobs:
4949 shell : bash
5050 run : |
5151 source "$HOME/.sdkman/bin/sdkman-init.sh"
52-
53- if ! sdk list java | grep -q "installed.*$JAVA_VERSION"; then
52+
53+ # install Java with sdkman, if not already installed
54+ if ! sdk list java | grep -q "$JAVA_VERSION"; then
5455 sdk install java "$JAVA_VERSION"
5556 fi
57+
5658 sdk use java "$JAVA_VERSION"
5759
5860 echo "JAVA_HOME=$HOME/.sdkman/candidates/java/current" >> $GITHUB_ENV
@@ -283,6 +285,7 @@ jobs:
283285 github.repository == 'beehive-lab/GPULlama3.java' &&
284286 github.event_name == 'push' &&
285287 github.ref == 'refs/heads/main'
288+
286289 runs-on : [self-hosted]
287290 needs : build-and-run
288291 timeout-minutes : 15
@@ -302,24 +305,36 @@ jobs:
302305 run : |
303306 python3 scripts/process_metrics.py \
304307 --metrics-dir "${{ runner.temp }}/metrics-artifacts" \
305- --commit "${{ github.sha }}" \
306- --branch "${{ github.ref_name }}" \
307- --run-id "${{ github.run_id }}" \
308- --run-number "${{ github.run_number }}" \
309- --run-attempt "${{ github.run_attempt }}" \
310- --workflow "${{ github.workflow }}" \
311- --history "$PERF_HISTORY_FILE"
308+ --commit "${{ github.sha }}" \
309+ --branch "${{ github.ref_name }}" \
310+ --run-id "${{ github.run_id }}" \
311+ --run-number "${{ github.run_number }}" \
312+ --run-attempt "${{ github.run_attempt }}" \
313+ --workflow "${{ github.workflow }}" \
314+ --history "$PERF_HISTORY_FILE"
312315
313316 - name : Commit performance history
314317 run : |
315- git config user.name "github-actions[bot]"
318+ SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-8)
319+
320+ git config user.name "github-actions[bot]"
316321 git config user.email "github-actions[bot]@users.noreply.github.com"
322+
317323 git add "$PERF_HISTORY_FILE"
318- git diff --cached --quiet && echo "No history changes to commit" && exit 0
319- git commit -m "perf: record run #${{ github.run_number }} @ ${GITHUB_SHA::8}"
324+
325+ git diff --cached --quiet && \
326+ echo "No history changes to commit" && exit 0
327+
328+ git commit -m "perf: record run #${{ github.run_number }} @ ${SHORT_SHA}"
329+
320330 for attempt in 1 2 3; do
321331 git pull --rebase origin main && git push && break || {
322- [ $attempt -lt 3 ] && { echo "Attempt $attempt failed, retrying in $((attempt * 5))s..."; sleep $((attempt * 5)); } \
323- || { echo "::error::Failed to push after 3 attempts"; exit 1; }
332+ if [ $attempt -lt 3 ]; then
333+ echo "Attempt $attempt failed, retrying in $((attempt * 5))s..."
334+ sleep $((attempt * 5))
335+ else
336+ echo "::error::Failed to push after 3 attempts"
337+ exit 1
338+ fi
324339 }
325- done
340+ done
0 commit comments