Configure shared sccache S3 setup (#4387)

This commit is contained in:
Bart Louwers
2026-07-08 14:00:17 +02:00
committed by GitHub
parent 15256b5767
commit e8aa3712bb
5 changed files with 148 additions and 106 deletions

View File

@@ -105,23 +105,10 @@ jobs:
with:
check_untracked: true
- name: Configure AWS Credentials
if: vars.OIDC_AWS_ROLE_TO_ASSUME
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
- name: Configure sccache
run: |
echo SCCACHE_BUCKET=maplibre-native-sccache >> "$GITHUB_ENV"
echo SCCACHE_REGION=eu-central-1 >> "$GITHUB_ENV"
if [ -z "${AWS_SECRET_ACCESS_KEY}" ]; then
echo "AWS_SECRET_ACCESS_KEY not set; not uploading sccache cache to S3"
echo SCCACHE_S3_NO_CREDENTIALS=1 >> "$GITHUB_ENV"
fi
uses: ./.github/actions/configure-sccache-s3
with:
vars: ${{ toJSON(vars) }}
- name: Check code style
if: matrix.renderer == 'opengl'
@@ -234,23 +221,10 @@ jobs:
run: zip -r test/android/app/src/main/assets/data.zip -@ < test/android/app/src/main/assets/to_zip.txt
working-directory: .
- name: Configure AWS Credentials
if: vars.OIDC_AWS_ROLE_TO_ASSUME
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
- name: Configure sccache
run: |
echo SCCACHE_BUCKET=maplibre-native-sccache >> "$GITHUB_ENV"
echo SCCACHE_REGION=eu-central-1 >> "$GITHUB_ENV"
if [ -z "${AWS_SECRET_ACCESS_KEY}" ]; then
echo "AWS_SECRET_ACCESS_KEY not set; not uploading sccache cache to S3"
echo SCCACHE_S3_NO_CREDENTIALS=1 >> "$GITHUB_ENV"
fi
uses: ./.github/actions/configure-sccache-s3
with:
vars: ${{ toJSON(vars) }}
- name: Build C++ Unit Tests App
run: |
@@ -288,23 +262,10 @@ jobs:
- uses: ./.github/actions/setup-android-ci
- name: Configure AWS Credentials
if: vars.OIDC_AWS_ROLE_TO_ASSUME
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
- name: Configure sccache
run: |
echo SCCACHE_BUCKET=maplibre-native-sccache >> "$GITHUB_ENV"
echo SCCACHE_REGION=eu-central-1 >> "$GITHUB_ENV"
if [ -z "${AWS_SECRET_ACCESS_KEY}" ]; then
echo "AWS_SECRET_ACCESS_KEY not set; not uploading sccache cache to S3"
echo SCCACHE_S3_NO_CREDENTIALS=1 >> "$GITHUB_ENV"
fi
uses: ./.github/actions/configure-sccache-s3
with:
vars: ${{ toJSON(vars) }}
- name: Build and Upload Render Test APKs (${{ matrix.flavor }})
uses: ./.github/actions/android-build-and-upload-render-test
@@ -329,23 +290,10 @@ jobs:
- uses: ./.github/actions/setup-android-ci
- name: Configure AWS Credentials
if: vars.OIDC_AWS_ROLE_TO_ASSUME
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
- name: Configure sccache
run: |
echo SCCACHE_BUCKET=maplibre-native-sccache >> "$GITHUB_ENV"
echo SCCACHE_REGION=eu-central-1 >> "$GITHUB_ENV"
if [ -z "${AWS_SECRET_ACCESS_KEY}" ]; then
echo "AWS_SECRET_ACCESS_KEY not set; not uploading sccache cache to S3"
echo SCCACHE_S3_NO_CREDENTIALS=1 >> "$GITHUB_ENV"
fi
uses: ./.github/actions/configure-sccache-s3
with:
vars: ${{ toJSON(vars) }}
- name: Build WebGPU Dawn library for arm64-v8a
run: ./gradlew :MapLibreAndroid:assembleWebgpuDawnDebug -Pmaplibre.abis=arm64-v8a
@@ -407,23 +355,10 @@ jobs:
export "${ENV_VAR}=--sysroot=$NDK_PREBUILT/sysroot --target=${{ env.BINDGEN_TARGET }} -isystem $RESOURCE_DIR/include"
cargo build --release --target ${{ env.RUST_TARGET }} --no-default-features --features vulkan,wgsl,spirv,glsl
- name: Configure AWS Credentials
if: vars.OIDC_AWS_ROLE_TO_ASSUME
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
- name: Configure sccache
run: |
echo SCCACHE_BUCKET=maplibre-native-sccache >> "$GITHUB_ENV"
echo SCCACHE_REGION=eu-central-1 >> "$GITHUB_ENV"
if [ -z "${AWS_SECRET_ACCESS_KEY}" ]; then
echo "AWS_SECRET_ACCESS_KEY not set; not uploading sccache cache to S3"
echo SCCACHE_S3_NO_CREDENTIALS=1 >> "$GITHUB_ENV"
fi
uses: ./.github/actions/configure-sccache-s3
with:
vars: ${{ toJSON(vars) }}
- name: Build WebGPU wgpu-native library for Android
run: ./gradlew :MapLibreAndroid:assembleWebgpuWgpuDebug -Pmaplibre.abis=${{ env.ANDROID_ARCH }}

View File

@@ -240,12 +240,30 @@ jobs:
with:
submodules: recursive
- name: Configure sccache
uses: ./.github/actions/configure-sccache-s3
with:
vars: ${{ toJSON(vars) }}
- name: Initialize sccache
run: |
sccache --start-server
sccache --zero-stats
- name: Configure build with CMake
run: cmake --preset ios-metal
run: |
cmake --preset ios-metal \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build mbgl-core
run: cmake --build build-ios --target mbgl-core ios-sdk-static app
- name: Show sccache stats
if: always()
run: |
sccache --show-stats
ios-build-webgpu-dawn:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
@@ -256,13 +274,31 @@ jobs:
submodules: recursive
persist-credentials: false
- name: Configure sccache
uses: ./.github/actions/configure-sccache-s3
with:
vars: ${{ toJSON(vars) }}
- name: Initialize sccache
run: |
sccache --start-server
sccache --zero-stats
- name: Configure build with CMake
run: cmake --preset ios-webgpu-dawn
run: |
cmake --preset ios-webgpu-dawn \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build mbgl-core and iOS SDK
continue-on-error: true
run: cmake --build build-ios-webgpu-dawn --target mbgl-core ios-sdk-static
- name: Show sccache stats
if: always()
run: |
sccache --show-stats
ios-build-webgpu-wgpu:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
@@ -286,12 +322,30 @@ jobs:
rustup target add aarch64-apple-ios --toolchain "$ACTIVE_TOOLCHAIN"
rustup target list --toolchain "$ACTIVE_TOOLCHAIN" --installed | grep -x 'aarch64-apple-ios'
- name: Configure sccache
uses: ./.github/actions/configure-sccache-s3
with:
vars: ${{ toJSON(vars) }}
- name: Initialize sccache
run: |
sccache --start-server
sccache --zero-stats
- name: Configure build with CMake
run: cmake --preset ios-webgpu-wgpu
run: |
RUSTC_WRAPPER=sccache cmake --preset ios-webgpu-wgpu \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
- name: Build mbgl-core and iOS SDK
continue-on-error: true
run: cmake --build build-ios-webgpu-wgpu --target mbgl-core ios-sdk-static
run: RUSTC_WRAPPER=sccache cmake --build build-ios-webgpu-wgpu --target mbgl-core ios-sdk-static
- name: Show sccache stats
if: always()
run: |
sccache --show-stats
ios-ci-result:
runs-on: ubuntu-latest

View File

@@ -86,8 +86,6 @@ jobs:
- if: matrix.variant.rust
run: cargo install cxxbridge-cmd --version 1.0.157 --locked
- uses: ./.github/actions/install-sccache
- name: Install ctcache
run: |
# pending open PR https://github.com/matus-chochlik/ctcache/pull/94
@@ -96,13 +94,10 @@ jobs:
cd ..
mv ctcache /usr/local/bin
- name: Configure AWS Credentials
if: vars.OIDC_AWS_ROLE_TO_ASSUME
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v4
- name: Configure sccache
uses: ./.github/actions/configure-sccache-s3
with:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
vars: ${{ toJSON(vars) }}
- name: Build MapLibre Native
env:
@@ -110,15 +105,6 @@ jobs:
run: |
cmake --version
# sccache configuration
export SCCACHE_BUCKET=maplibre-native-sccache
export SCCACHE_REGION=eu-central-1
if [ -z "${AWS_SECRET_ACCESS_KEY}" ]; then
echo "AWS_SECRET_ACCESS_KEY not set; not uploading sccache cache to S3"
export SCCACHE_S3_NO_CREDENTIALS=1
fi
# ctcache configuration
export CTCACHE_HOST=34.229.50.221
export CTCACHE_PORT=5000