Cache depends sources #59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Cache depends sources | |
| on: | |
| workflow_call: | |
| inputs: | |
| runs-on: | |
| description: "Runner label to use" | |
| required: false | |
| type: string | |
| default: ubuntu-24.04-arm | |
| schedule: | |
| # Run daily at 6 AM UTC on the default branch to keep cache warm | |
| - cron: '0 6 * * *' | |
| jobs: | |
| cache-sources: | |
| name: Cache depends sources | |
| # Intentionally keep scheduled cache warming on GitHub-hosted ARM runners. | |
| # Blacksmith caches are expected to persist long enough without a warmup cron. | |
| runs-on: ${{ inputs.runs-on || 'ubuntu-24.04-arm' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Check for cached sources | |
| id: cache-check | |
| uses: actions/cache@v5 | |
| with: | |
| path: depends/sources | |
| key: depends-sources-${{ hashFiles('depends/packages/*') }} | |
| restore-keys: depends-sources- | |
| lookup-only: true | |
| - name: Download sources | |
| if: steps.cache-check.outputs.cache-hit != 'true' | |
| run: make -C depends download |