Skip to content

test cache fetch workflow #2

test cache fetch workflow

test cache fetch workflow #2

Workflow file for this run

name: Check GHA cache
on: push
jobs:
check-cache:
runs-on: ubuntu-latest
steps:
- name: Generate random data
run: |
GHA_CACHE_DIR="$(mktemp -d)"
echo GHA_CACHE_DIR="$GHA_CACHE_DIR" >> "$GITHUB_ENV"
dd if=/dev/urandom of="$GHA_CACHE_DIR/data" bs=1024 count=1
- name: Store cache entry
uses: actions/cache/save@v5
with:
path: ${{ env.GHA_CACHE_DIR }}
key: 'gha-cache-check'
- name: Verify cache entry
id: verify
uses: actions/cache/restore@v5
with:
path: ${{ env.GHA_CACHE_DIR }}
key: 'gha-cache-check'
- name: Fail on cache miss
if: steps.verify.outputs.cache-hit != 'true'
run: exit 1