Skip to content

Commit

Permalink
Enable cache for Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed May 24, 2024
1 parent 1f7f7ee commit ba6be3c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}

- name: Download compiler-rt reference sources
run: |
curl -L -o code.tar.gz https://github.com/rust-lang/llvm-project/archive/rustc/18.0-2024-02-13.tar.gz
Expand Down
16 changes: 15 additions & 1 deletion ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,21 @@ run() {
export RUST_COMPILER_RT_ROOT=./compiler-rt
fi

docker build \
if [ "$GITHUB_ACTIONS" = "true" ]; then
# Enable Docker image caching
echo "running in CI"
buildx="buildx"
build_args=(
"${build_args[@]:-}"
"--cache-to" "type=gha"
"--cache-from" "type=gha"
)

echo $buildx
echo $build_args
fi

docker "${buildx:-}" build \
-t "builtins-$target" \
${build_args[@]:-} \
"ci/docker/$target"
Expand Down

0 comments on commit ba6be3c

Please sign in to comment.