ci: add temporary actions/cache smoke test
Verifying actions/cache is functional on this Gitea Actions runner before building CI speed improvements on top of it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
name: Cache smoke test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ci-cache-speedup]
|
||||
|
||||
jobs:
|
||||
cache-write:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create cache payload
|
||||
run: |
|
||||
mkdir -p /tmp/cache-smoke
|
||||
echo "hello-${{ github.run_id }}" > /tmp/cache-smoke/data.txt
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/cache-smoke
|
||||
key: cache-smoke-${{ github.run_id }}
|
||||
|
||||
cache-read:
|
||||
runs-on: ubuntu-latest
|
||||
needs: cache-write
|
||||
steps:
|
||||
- uses: actions/cache@v4
|
||||
id: restore
|
||||
with:
|
||||
path: /tmp/cache-smoke
|
||||
key: cache-smoke-${{ github.run_id }}
|
||||
|
||||
- name: Verify cache was restored
|
||||
run: |
|
||||
if [ "${{ steps.restore.outputs.cache-hit }}" != "true" ]; then
|
||||
echo "cache-hit was not true: '${{ steps.restore.outputs.cache-hit }}'" >&2
|
||||
exit 1
|
||||
fi
|
||||
test -f /tmp/cache-smoke/data.txt
|
||||
cat /tmp/cache-smoke/data.txt
|
||||
test "$(cat /tmp/cache-smoke/data.txt)" = "hello-${{ github.run_id }}"
|
||||
echo "actions/cache works on this runner"
|
||||
Reference in New Issue
Block a user