|
| 1 | +name: Trace Ace Transcript Cache Seed |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: |
| 7 | + - '.github/workflows/trace-ace-transcript-cache-seed.yml' |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: trace-ace-frozen-transcripts-v1 |
| 12 | + cancel-in-progress: false |
| 13 | + |
| 14 | +jobs: |
| 15 | + seed: |
| 16 | + runs-on: ubuntu-24.04 |
| 17 | + timeout-minutes: 15 |
| 18 | + steps: |
| 19 | + - name: Install gdown |
| 20 | + run: python -m pip install --disable-pip-version-check gdown |
| 21 | + |
| 22 | + - name: Restore frozen transcript archive from GitHub cache |
| 23 | + id: transcript-cache |
| 24 | + uses: actions/cache@v4 |
| 25 | + with: |
| 26 | + path: transcripts.zip |
| 27 | + key: trace-ace-transcripts-v1-603547640 |
| 28 | + |
| 29 | + - name: Download frozen transcript archive on cache miss |
| 30 | + if: steps.transcript-cache.outputs.cache-hit != 'true' |
| 31 | + shell: bash |
| 32 | + run: | |
| 33 | + set -euo pipefail |
| 34 | + for id in \ |
| 35 | + 1nOjremWhpZ_QKSLvZfGcNkS_C3kMMBUI \ |
| 36 | + 1vkgFdcw-rnlueCgGsKKbUUXql8GyGmET |
| 37 | + do |
| 38 | + rm -f transcripts.zip |
| 39 | + echo "Trying frozen transcript source $id" |
| 40 | + if gdown "$id" -O transcripts.zip; then |
| 41 | + bytes=$(stat -c%s transcripts.zip) |
| 42 | + echo "Downloaded $bytes bytes" |
| 43 | + if [ "$bytes" = "603547640" ]; then |
| 44 | + echo "Frozen transcript archive size verified" |
| 45 | + break |
| 46 | + fi |
| 47 | + echo "Unexpected transcript archive size: $bytes" >&2 |
| 48 | + fi |
| 49 | + rm -f transcripts.zip |
| 50 | + done |
| 51 | + test -f transcripts.zip |
| 52 | + test "$(stat -c%s transcripts.zip)" = "603547640" |
| 53 | + unzip -tq transcripts.zip >/dev/null |
| 54 | + echo "Frozen transcript archive ZIP integrity verified" |
| 55 | +
|
| 56 | + - name: Report cache state |
| 57 | + shell: bash |
| 58 | + run: | |
| 59 | + set -euo pipefail |
| 60 | + echo "cache-hit=${{ steps.transcript-cache.outputs.cache-hit }}" |
| 61 | + echo "cache-key=trace-ace-transcripts-v1-603547640" |
| 62 | + echo "archive-bytes=$(stat -c%s transcripts.zip)" |
0 commit comments