Cache Management #3
This file contains 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 Warmup | |
on: | |
schedule: | |
- cron: '0 0 */3 * *' | |
workflow_dispatch: | |
jobs: | |
warmup-unix: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, macos-15] | |
device: [cpu, metal, cuda] | |
exclude: | |
- os: macos-15 | |
device: cpu | |
- os: macos-15 | |
device: cuda | |
# TODO: Remove on release | |
- os: macos-15 | |
device: metal | |
- os: ubuntu-22.04 | |
device: metal | |
container: ${{ matrix.device == 'cuda' && 'nvidia/cuda:12.8.0-devel-ubuntu22.04' || '' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run sccache-cache | |
uses: mozilla-actions/sccache-action@v0.0.7 | |
- name: Configure sccache | |
id: sccache | |
run: | | |
mkdir -p "$PWD/bindings/.sccache" | |
export SCCACHE_DIR="$PWD/bindings/.sccache" | |
echo "SCCACHE_DIR=$SCCACHE_DIR" >> $GITHUB_ENV | |
- name: Cache sccache storage | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.SCCACHE_DIR }} | |
key: sccache-${{ runner.os }}-${{ matrix.device }}-${{ github.ref_name }} | |
restore-keys: | | |
sccache-${{ runner.os }}-${{ matrix.device }}- | |
warmup-win: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-2022] | |
device: [cpu, cuda] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run sccache-cache | |
uses: mozilla-actions/sccache-action@v0.0.7 | |
- name: Configure sccache | |
run: | | |
New-Item -ItemType Directory -Force -Path "$PWD/bindings/.sccache" | |
$env:SCCACHE_DIR="$PWD/bindings/.sccache" | |
echo "SCCACHE_DIR=$env:SCCACHE_DIR" >> $env:GITHUB_ENV | |
- name: Cache sccache storage | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.SCCACHE_DIR }} | |
key: sccache-${{ runner.os }}-${{ matrix.device }}-${{ github.ref_name }} | |
restore-keys: | | |
sccache-${{ runner.os }}-${{ matrix.device }}- |