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 53459b3
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 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}}
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 All @@ -46,6 +50,10 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca
with:
driver-opts: |
image=moby/buildkit:latest
cache-path=/tmp/.buildx-cache
- name: check
run: just check
Expand Down

0 comments on commit 53459b3

Please sign in to comment.