Skip to content

Commit 3c3608a

Browse files
[ci] Fix github syntax issues
1 parent e2a1efd commit 3c3608a

2 files changed

Lines changed: 42 additions & 27 deletions

File tree

.github/workflows/build-and-run.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.github/workflows/integration-quarkus-langchain4j.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ on:
44
push:
55
branches: [ main ]
66
pull_request:
7-
branches: [ main ]
8-
types: [opened, synchronize, reopened]
7+
branches: [ main ]
8+
types: [opened, synchronize, reopened]
99
schedule:
10-
# Run every Saturday at 02:30 UTC to catch dependency breakages
11-
- cron: '30 2 * * 6'
10+
# Run every Saturday at 02:30 UTC to catch dependency breakages
11+
- cron: '30 2 * * 6'
1212
workflow_dispatch:
1313
inputs:
1414
quarkus_langchain4j_version:
@@ -77,7 +77,7 @@ jobs:
7777
7878
# Build
7979
./mvnw clean install -DskipTests
80-
80+
8181
# Save GPULlama3.java version for subsequent steps
8282
echo "GPULLAMA3_VERSION=$GPULLAMA3_VERSION" >> $GITHUB_ENV
8383
@@ -156,15 +156,15 @@ jobs:
156156
MAX_ATTEMPTS=3
157157
ATTEMPT=1
158158
SUCCESS=false
159-
159+
160160
while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do
161161
echo "Attempt $ATTEMPT of $MAX_ATTEMPTS for blocking endpoint..."
162-
162+
163163
# Trigger endpoint
164164
HTTP_RESPONSE=$(curl -s -w "%{http_code}" http://localhost:$QUARKUS_PORT/chat/blocking)
165165
HTTP_RESPONSE_CODE="${HTTP_RESPONSE: -3}"
166166
HTTP_RESPONSE_BODY="${HTTP_RESPONSE%???}"
167-
167+
168168
# Check response code
169169
if [ "$HTTP_RESPONSE_CODE" = "200" ]; then
170170
echo "SUCCESS: Blocking endpoint returned HTTP code: $HTTP_RESPONSE_CODE"
@@ -174,16 +174,16 @@ jobs:
174174
else
175175
echo "Attempt $ATTEMPT failed: Blocking endpoint returned HTTP code $HTTP_RESPONSE_CODE"
176176
echo "Response body: $HTTP_RESPONSE_BODY"
177-
177+
178178
if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then
179179
echo "Retrying in 2 seconds..."
180180
sleep 2
181181
fi
182182
fi
183-
183+
184184
ATTEMPT=$((ATTEMPT + 1))
185185
done
186-
186+
187187
if [ "$SUCCESS" = false ]; then
188188
echo "ERROR: Blocking endpoint failed after $MAX_ATTEMPTS attempts"
189189
exit 1
@@ -233,4 +233,4 @@ jobs:
233233
run: |
234234
# Clean shutdown
235235
kill $APP_PID || true
236-
wait $APP_PID 2>/dev/null || true
236+
wait $APP_PID 2>/dev/null || true

0 commit comments

Comments
 (0)