Skip to content

Commit

Permalink
add scope
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed May 24, 2024
1 parent 33ff7ee commit 1908bf7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ jobs:
NO_STD: ${{ matrix.no_std }}
TEST_VERBATIM: ${{ matrix.test_verbatim }}

# Configure buildx to use Docker layer caching
- uses: docker/setup-buildx-action@v3
if: matrix.os == 'ubuntu-latest'

# Otherwise we use our docker containers to run builds
- run: cargo generate-lockfile && ./ci/run-docker.sh ${{ matrix.target }}
if: matrix.os == 'ubuntu-latest'
Expand Down
8 changes: 6 additions & 2 deletions ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ run() {

if [ "$GITHUB_ACTIONS" = "true" ]; then
# Enable Docker image caching
if [ -n "$TARGET" ]; then
extra_cache_args=",scope=$TARGET"
fi

buildx="buildx"
build_args=(
"${build_args[@]:-}"
"--cache-to" "type=gha"
"--cache-from" "type=gha"
"--cache-to" "type=gha${extra_cache_args:-}"
"--cache-from" "type=gha${extra_cache_args:-}"
)
fi

Expand Down

0 comments on commit 1908bf7

Please sign in to comment.