mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
committed by
GitHub
parent
4ab228b498
commit
68fe5d8b36
30
.github/actions/cache/action.yml
vendored
30
.github/actions/cache/action.yml
vendored
@@ -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 }}
|
||||
20
.github/actions/setup-tinygrad/action.yml
vendored
20
.github/actions/setup-tinygrad/action.yml
vendored
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user