diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 18bed3548..1631aa39a 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -267,6 +267,8 @@ jobs: (needs.check-changes.outputs.main_package == 'true') runs-on: ubuntu-latest timeout-minutes: 240 + env: + HF_HOME: ${{ github.workspace }}/.hf-cache strategy: fail-fast: false max-parallel: ${{ fromJson(needs.check-changes.outputs.partitions)['base-a-test-cpu'].max_parallel }} @@ -316,6 +318,16 @@ jobs: run: | uv pip install -e "python[dev]" --index-strategy unsafe-best-match --prerelease allow + # Hosted runners are ephemeral, so models are re-fetched every run and the + # Hub occasionally returns 429s. Persist the HF cache in GitHub's cache + # storage (rolling key + restore-keys) so warm runs never hit the network. + - name: Cache HF hub + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.hf-cache + key: hf-cpu-${{ matrix.partition }}-${{ github.run_id }} + restore-keys: hf-cpu-${{ matrix.partition }}- + - name: Run test timeout-minutes: 10 env: