Files
MapLibreParticleLab/.github/actions/configure-sccache-s3/action.yml
2026-07-08 12:00:17 +00:00

44 lines
1.4 KiB
YAML

name: configure-sccache-s3
description: "Install sccache and configure AWS credentials and S3 cache"
inputs:
vars:
description: "JSON-encoded GitHub Actions vars context"
required: false
default: "{}"
sccache-bucket:
description: "S3 bucket used by sccache"
required: false
default: maplibre-native-sccache
sccache-region:
description: "S3 bucket region used by sccache"
required: false
default: eu-central-1
runs:
using: "composite"
steps:
- name: Install sccache
shell: bash
run: "$GITHUB_ACTION_PATH/../install-sccache/install-sccache"
- name: Configure AWS Credentials
if: fromJSON(inputs.vars).OIDC_AWS_ROLE_TO_ASSUME
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v4
with:
aws-region: us-west-2
role-to-assume: ${{ fromJSON(inputs.vars).OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
- name: Configure sccache
shell: bash
env:
SCCACHE_BUCKET: ${{ inputs.sccache-bucket }}
SCCACHE_REGION: ${{ inputs.sccache-region }}
run: |
echo "SCCACHE_BUCKET=${SCCACHE_BUCKET}" >> "$GITHUB_ENV"
echo "SCCACHE_REGION=${SCCACHE_REGION}" >> "$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