44 lines
1.4 KiB
YAML
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@517a711dbcd0e402f90c77e7e2f81e849156e31d # v6.2.2
|
|
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
|