From 68fe5d8b36d105708d0cb5a079fe2b6263ebad44 Mon Sep 17 00:00:00 2001 From: Christopher Milan Date: Tue, 27 Jan 2026 20:22:26 -0800 Subject: [PATCH] Revert "don't save caches for PRs (#14389)" (#14390) --- .github/actions/cache/action.yml | 30 ----------------------- .github/actions/setup-tinygrad/action.yml | 20 +++++++++------ 2 files changed, 13 insertions(+), 37 deletions(-) delete mode 100644 .github/actions/cache/action.yml diff --git a/.github/actions/cache/action.yml b/.github/actions/cache/action.yml deleted file mode 100644 index f3bd57ab13..0000000000 --- a/.github/actions/cache/action.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Cache -description: Wraps actions/cache to disable save for PRs -inputs: - path: - description: 'A list of files, directories, and wildcard patterns to cache and restore' - required: true - key: - description: 'An explicit key for restoring and saving the cache' - required: true -outputs: - cache-hit: - description: 'A boolean value to indicate an exact match was found for the primary key' - value: ${{ steps.restore-only.outputs.cache-hit || steps.restore-save.outputs.cache-hit }} -runs: - using: "composite" - steps: - - name: Restore Cache (PR) - if: github.event_name == 'pull_request' - id: restore-only - uses: actions/cache/restore@v4 - with: - path: ${{ inputs.path }} - key: ${{ inputs.key }} - - name: Restore and Save Cache - if: github.event_name != 'pull_request' - id: restore-save - uses: actions/cache@v4 - with: - path: ${{ input.path }} - key: ${{ input.key }} diff --git a/.github/actions/setup-tinygrad/action.yml b/.github/actions/setup-tinygrad/action.yml index 3112430a27..fb9493862d 100644 --- a/.github/actions/setup-tinygrad/action.yml +++ b/.github/actions/setup-tinygrad/action.yml @@ -58,18 +58,24 @@ runs: - name: Cache Python packages id: restore-venv - uses: ./.github/actions/cache + uses: actions/cache@v4 with: path: ${{ github.workspace }}/.venv key: venv-${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-${{ inputs.deps }}-${{ inputs.pydeps }}-${{ env.CACHE_VERSION }} # **** Caching downloads **** - - name: Cache downloads - if: inputs.key != '' - uses: ./.github/actions/cache + - name: Cache downloads (Linux) + if: inputs.key != '' && runner.os == 'Linux' + uses: actions/cache@v4 with: - path: ${{ runner.os == 'Linux' && '~/.cache/tinygrad/downloads/' || '~/Library/Caches/tinygrad/downloads/' }} + path: ~/.cache/tinygrad/downloads/ + key: downloads-${{ github.job }}-${{ inputs.key }}-${{ env.CACHE_VERSION }} + - name: Cache downloads (macOS) + if: inputs.key != '' && runner.os == 'macOS' + uses: actions/cache@v4 + with: + path: ~/Library/Caches/tinygrad/downloads/ key: downloads-${{ github.job }}-${{ inputs.key }}-${{ env.CACHE_VERSION }} # **** Python deps **** @@ -178,7 +184,7 @@ runs: - name: Cache apt if: runner.os == 'Linux' && (inputs.opencl == 'true' || inputs.amd == 'true' || inputs.cuda == 'true' || inputs.webgpu == 'true' || inputs.llvm == 'true') - uses: ./.github/actions/cache + uses: actions/cache@v4 with: path: /var/cache/apt/archives/ key: ${{ runner.os }}-apt-${{ steps.apt-pkgs.outputs.hash }}-${{ env.CACHE_VERSION }} @@ -236,7 +242,7 @@ runs: - name: Cache gpuocelot if: inputs.ocelot == 'true' id: cache-build - uses: ./.github/actions/cache + uses: actions/cache@v4 env: cache-name: cache-gpuocelot-build-1 with: