Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ x-cpp: &cpp
x-sccache: &sccache
AWS_ACCESS_KEY_ID:
AWS_SECRET_ACCESS_KEY:
AWS_SESSION_TOKEN:
SCCACHE_BUCKET:
SCCACHE_REGION:
SCCACHE_S3_KEY_PREFIX: ${SCCACHE_S3_KEY_PREFIX:-sccache}
Expand Down
6 changes: 6 additions & 0 deletions dev/tasks/docker-tests/github.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

{{ macros.github_header() }}

permissions:
contents: read
# For OIDC token for sccache
id-token: write

jobs:
test:
name: |
Expand All @@ -31,6 +36,7 @@ jobs:
{{ macros.github_free_space()|indent }}
{{ macros.github_install_archery()|indent }}

{{ macros.github_configure_aws_credentials()|indent }}
- name: Execute Docker Build
shell: bash
env:
Expand Down
16 changes: 14 additions & 2 deletions dev/tasks/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:

env:
ARCHERY_DEBUG: 1
SCCACHE_ENABLED: {{ "${{ secrets.SCCACHE_REGION != '' }}" }}
{% endmacro %}

{%- macro github_checkout_arrow(fetch_depth=1, submodules="recursive", action_v="4") -%}
Expand Down Expand Up @@ -287,10 +288,21 @@ env:
{% endif %}
{%- endmacro -%}

{%- macro github_configure_aws_credentials() -%}
- name: Configure AWS credentials for sccache
if: env.SCCACHE_ENABLED == 'true'
uses: aws-actions/configure-aws-credentials@v6
with:
aws-region: {{ '${{ secrets.SCCACHE_REGION }}' }}
role-to-assume: {{ '${{ secrets.AWS_ROLE_ARN }}' }}
role-duration-seconds: 14400
{% endmacro %}

{% macro github_set_sccache_envvars(sccache_key_prefix = "sccache") %}
{% set sccache_vars = {
"AWS_ACCESS_KEY_ID": '${{ secrets.AWS_ACCESS_KEY_ID }}',
"AWS_SECRET_ACCESS_KEY": '${{ secrets.AWS_SECRET_ACCESS_KEY }}',
"AWS_ACCESS_KEY_ID": '${{ env.AWS_ACCESS_KEY_ID }}',
"AWS_SECRET_ACCESS_KEY": '${{ env.AWS_SECRET_ACCESS_KEY }}',
"AWS_SESSION_TOKEN": '${{ env.AWS_SESSION_TOKEN }}',
"SCCACHE_BUCKET": '${{ secrets.SCCACHE_BUCKET }}',
"SCCACHE_REGION": '${{ secrets.SCCACHE_REGION }}',
"SCCACHE_S3_KEY_PREFIX": sccache_key_prefix
Expand Down
Loading