CI(compute-tools): enable sccache

This commit is contained in:
Alexander Bayandin
2024-06-30 11:15:40 +01:00
parent 0a0e7f3486
commit 6fca885a86
2 changed files with 19 additions and 1 deletions

View File

@@ -867,6 +867,9 @@ jobs:
PG_VERSION=${{ matrix.version }}
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}
RUSTC_WRAPPER=sccache
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_DEV }}
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_KEY_DEV }}
provenance: false
push: true
pull: true
@@ -907,6 +910,9 @@ jobs:
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}
RUSTC_WRAPPER=sccache
AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_DEV }}
AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_KEY_DEV }}
provenance: false
push: true
pull: true

View File

@@ -868,10 +868,22 @@ FROM $REPOSITORY/$IMAGE:$TAG AS compute-tools
ARG BUILD_TAG
ENV BUILD_TAG=$BUILD_TAG
ARG RUSTC_WRAPPER
ARG SCCACHE_BUCKET=neon-github-dev
ARG SCCACHE_REGION=eu-central-1
ARG SCCACHE_S3_KEY_PREFIX=sccache
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
USER nonroot
# Copy entire project to get Cargo.* files with proper dependencies for the whole project
COPY --chown=nonroot . .
RUN cd compute_tools && mold -run cargo build --locked --profile release-line-debug-size-lto
RUN set -e \
&& RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=mold -Clink-arg=-Wl,--no-rosegment" cargo build \
--bin compute_ctl \
--locked \
--profile release-line-debug-size-lto \
&& sccache --show-stats
#########################################################################################
#