Skip to content

Commit

Permalink
chore: conditionally set sccache token
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 25, 2024
1 parent b563597 commit 39267c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
SCCACHE_BUCKET: sccache
SCCACHE_REGION: auto
SCCACHE_S3_NO_CREDENTIALS: ${{ secrets.MINIO_AWS_ACCESS_KEY_ID && '0' || '1' }}
AWS_ACCESS_KEY_ID: ${{ secrets.MINIO_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.MINIO_AWS_SECRET_ACCESS_KEY }}
MINIO_AWS_ACCESS_KEY_ID: ${{ secrets.MINIO_AWS_ACCESS_KEY_ID }}
MINIO_AWS_SECRET_ACCESS_KEY: ${{ secrets.MINIO_AWS_SECRET_ACCESS_KEY }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -82,6 +82,10 @@ jobs:
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTS_P12 }}
p12-password: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTS_P12_PASS }}
- uses: actions/checkout@v4
- if: ${{ env.SCCACHE_S3_NO_CREDENTIALS == '0' }}
run: |
echo AWS_ACCESS_KEY_ID=$MINIO_AWS_ACCESS_KEY_ID >> $GITHUB_ENV
echo AWS_SECRET_ACCESS_KEY=$MINIO_AWS_SECRET_ACCESS_KEY >> $GITHUB_ENV
- uses: mozilla-actions/[email protected]
- name: cache crates
id: cache-crates
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ env:
SCCACHE_ENDPOINT: minio.jdx.dev
SCCACHE_BUCKET: sccache
SCCACHE_REGION: auto
SCCACHE_S3_NO_CREDENTIALS: ${{ secrets.MINIO_AWS_ACCESS_KEY_ID && '0' || '1' }}
AWS_ACCESS_KEY_ID: ${{ secrets.MINIO_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.MINIO_AWS_SECRET_ACCESS_KEY }}
SCCACHE_S3_NO_CREDENTIALS: ${{ secrets.MINIO_AWS_ACCESS_KEY_ID && '1' || '0' }}
MINIO_AWS_ACCESS_KEY_ID: ${{ secrets.MINIO_AWS_ACCESS_KEY_ID }}
MINIO_AWS_SECRET_ACCESS_KEY: ${{ secrets.MINIO_AWS_SECRET_ACCESS_KEY }}

permissions:
pull-requests: write
Expand All @@ -39,6 +39,10 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN || github.token }}
- if: ${{ env.SCCACHE_S3_NO_CREDENTIALS == '0' }}
run: |
echo AWS_ACCESS_KEY_ID=$MINIO_AWS_ACCESS_KEY_ID >> $GITHUB_ENV
echo AWS_SECRET_ACCESS_KEY=$MINIO_AWS_SECRET_ACCESS_KEY >> $GITHUB_ENV
- uses: mozilla-actions/[email protected]
- uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: stable, components: rustfmt }
Expand Down Expand Up @@ -86,6 +90,10 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN || github.token }}
- if: ${{ env.SCCACHE_S3_NO_CREDENTIALS == '0' }}
run: |
echo AWS_ACCESS_KEY_ID=$MINIO_AWS_ACCESS_KEY_ID >> $GITHUB_ENV
echo AWS_SECRET_ACCESS_KEY=$MINIO_AWS_SECRET_ACCESS_KEY >> $GITHUB_ENV
- uses: mozilla-actions/[email protected]
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
Expand Down Expand Up @@ -126,6 +134,10 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- if: ${{ env.SCCACHE_S3_NO_CREDENTIALS == '0' }}
run: |
echo AWS_ACCESS_KEY_ID=$MINIO_AWS_ACCESS_KEY_ID >> $GITHUB_ENV
echo AWS_SECRET_ACCESS_KEY=$MINIO_AWS_SECRET_ACCESS_KEY >> $GITHUB_ENV
- uses: mozilla-actions/[email protected]
- uses: Swatinem/rust-cache@v2
with:
Expand Down

0 comments on commit 39267c4

Please sign in to comment.