Skip to content

Commit ad27c64

Browse files
committed
Address CI PR review comments
- Remove workflow_dispatch trigger (PR-only) - Add comment explaining self-hosted runner requirement - Use repository variables with defaults for SMB config - Skip integration test on fork PRs (secret unavailable) - Assert cache hits > 0 and write errors == 0 in test script
1 parent db7ff2d commit ad27c64

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: CI
22

33
on:
44
pull_request:
5-
workflow_dispatch:
65

76
concurrency:
87
group: ${{ github.workflow }}-${{ github.ref }}
@@ -16,6 +15,7 @@ env:
1615
jobs:
1716
ci:
1817
name: Format, lint, build, and test
18+
# Self-hosted macOS runner required for CommonCrypto FFI and NAS access
1919
runs-on: spiceai-macos
2020
permissions:
2121
contents: read
@@ -51,13 +51,15 @@ jobs:
5151
run: cargo test --locked
5252

5353
- name: Run sccache integration test
54+
# Skipped on fork PRs where the secret is unavailable
55+
if: ${{ secrets.UNAS_SMB_PASS != '' }}
5456
env:
55-
SPICEIO_SMB_SERVER: 192.168.3.148
56-
SPICEIO_SMB_USER: runner
57+
SPICEIO_SMB_SERVER: ${{ vars.SPICEIO_SMB_SERVER || '192.168.3.148' }}
58+
SPICEIO_SMB_USER: ${{ vars.SPICEIO_SMB_USER || 'runner' }}
5759
SPICEIO_SMB_PASS: ${{ secrets.UNAS_SMB_PASS }}
58-
SPICEIO_SMB_SHARE: ai_platform_dev
59-
SPICEIO_BUCKET: spiceio
60-
SPICEIO_REGION: us-west-1
60+
SPICEIO_SMB_SHARE: ${{ vars.SPICEIO_SMB_SHARE || 'ai_platform_dev' }}
61+
SPICEIO_BUCKET: ${{ vars.SPICEIO_BUCKET || 'spiceio' }}
62+
SPICEIO_REGION: ${{ vars.SPICEIO_REGION || 'us-west-1' }}
6163
run: ./scripts/test-sccache.sh
6264

6365
- name: Build release artifact

scripts/test-sccache.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,17 @@ echo "[test] sccache stats:"
267267
echo "======================================="
268268
sccache --show-stats
269269
echo "======================================="
270+
271+
# ── Verify cache hits ───────────────────────────────────────────────────────
272+
273+
STATS=$(sccache --show-stats 2>&1)
274+
CACHE_HITS=$(echo "$STATS" | grep -m1 "^Cache hits" | awk '{print $NF}')
275+
WRITE_ERRORS=$(echo "$STATS" | grep -m1 "Cache write errors" | awk '{print $NF}')
276+
277+
echo ""
278+
if [[ "${CACHE_HITS:-0}" -gt 0 && "${WRITE_ERRORS:-0}" -eq 0 ]]; then
279+
echo "[test] PASS: warm build got $CACHE_HITS cache hits, 0 write errors"
280+
else
281+
echo "[test] FAIL: expected cache hits > 0 (got ${CACHE_HITS:-0}) and write errors == 0 (got ${WRITE_ERRORS:-0})"
282+
exit 1
283+
fi

0 commit comments

Comments
 (0)