Skip to content

Commit 7abb0ce

Browse files
authored
Merge pull request #2449 from DARMA-tasking/2448-enable-caching-with-docker-bake
#2448: ci: bake: enable local output and use it for caching
2 parents 9b2df33 + 0ec78f8 commit 7abb0ce

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.github/workflows/build-docker-images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
- uses: actions/cache@v4
4343
with:
44-
path: ~/ccache
44+
path: docker-output/build/ccache
4545
key: ${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
4646
restore-keys: ${{ matrix.target }}-${{ github.ref }}
4747

ci/docker/vt.dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ ARG VT_UNITY_BUILD_ENABLED
4040
ARG VT_WERROR_ENABLED
4141
ARG VT_ZOLTAN_ENABLED
4242

43-
RUN --mount=target=/vt --mount=type=cache,target=/build/ccache \
43+
RUN --mount=target=/vt \
44+
<<EOF
45+
if [ -d vt/docker-output/build/ccache ]; then
46+
cp -r vt/docker-output/build/ccache /build
47+
ccache -c
48+
ccache -s
49+
fi
50+
EOF
51+
52+
RUN --mount=target=/vt \
4453
/vt/ci/build_cpp.sh /vt /build && \
4554
/vt/ci/test_cpp.sh /vt /build && \
4655
/vt/ci/build_vt_sample.sh /vt /build

docker-bake.hcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ target "vt-build" {
167167
target = "build"
168168
context = "."
169169
dockerfile = "ci/docker/vt.dockerfile"
170+
output = [
171+
{
172+
type = "local"
173+
dest = "docker-output"
174+
}
175+
]
170176
platforms = [
171177
"linux/amd64",
172178
# "linux/arm64"

0 commit comments

Comments
 (0)