Skip to content

Commit

Permalink
test8
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodearnest committed Feb 12, 2025
1 parent d1b5397 commit 3fab5e9
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,27 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355

- name: Set cache key
id: cache_key
# v1 uses a different input
- name: Calculate cache key content hash
id: cache_content_key
# Because we want to dynamically include matrix.version in the path, we
# cannot use GHAs hashFiles construct, and have to DIY it.
run: |
if [ "${{ matrix.version }}" = "v1" ]; then
cache_key="${{ runner.os }}-${{ matrix.version }}-buildx-${{ hashFiles('v1/renv.lock') }}"
# v1 uses renv
path="v1/renv.lock"
else
cache_key="${{ runner.os }}-${{ matrix.version }}-buildx-${{ hashFiles(format('{0}/packages.toml', matrix.version)) }}"
# v2+ use our custom toml format, in the matrix.version subdir
path="${{ matrix.version }}/packages.toml"
fi
echo "cache_key=$cache_key" >> "$GITHUB_OUTPUT"
echo "Generated cache key: $cache_key"
key=$(sha256sum $path | awk '{print $1}')
echo "cache_content_key=$key" >> "$GITHUB_OUTPUT"
echo "Generated cache_content_key for $path: $key"
- name: Cache Docker buildx caches
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ steps.cache_key.outputs.cache_key}}
path: /var/lib/buildkit
key: ${{ runner.os }}-${{ matrix.version }}-buildx-${{ steps.cache_content_key.outputs.cache_content_key }}
# fallback to older cache keys if needed
restore-keys: |
${{ runner.os }}-${{ matrix.version }}-buildx-
Expand Down

0 comments on commit 3fab5e9

Please sign in to comment.