Skip to content

Commit

Permalink
fix(ci): disable sccache when secrets not avail (#874)
Browse files Browse the repository at this point in the history
- Makes sccache optional so PRs from dependabot and forks can still run
the test suite.
- Increases sccache allotment to 50g.

---------

Signed-off-by: Yohe-Am <[email protected]>
  • Loading branch information
Yohe-Am authored Oct 16, 2024
1 parent cae1342 commit a3310f4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ updates:
exclude-patterns:
- "swc_*"
- package-ecosystem: pip
directory: /typegraph
directory: /src/typegraph
schedule:
interval: monthly
groups:
Expand All @@ -35,7 +35,7 @@ updates:
patterns:
- "*"
- package-ecosystem: npm
directory: /website
directory: /docs
schedule:
interval: monthly
groups:
Expand Down
32 changes: 23 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review

Expand All @@ -20,18 +21,17 @@ env:
GHJK_ENV: "ci"
RUST_BACKTRACE: "full"
DENO_DIR: deno-dir
RUSTC_WRAPPER: "sccache"
# used by ghjk
# TODO: add logic to setup-ghjk
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_BUILD_NO_SUMMARY: true
SCCACHE_BUCKET: "metacache"
SCCACHE_ENDPOINT: "https://s3.pub1.infomaniak.cloud"
SCCACHE_REGION: "us-east-1"
SCCACHE_S3_USE_SSL: "true"
SCCACHE_CACHE_SIZE: "30G"
SCCACHE_CACHE_SIZE: "50G"
AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
# used by ghjk
# TODO: add logic to setup-ghjk
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_BUILD_NO_SUMMARY: true

jobs:
changes:
Expand Down Expand Up @@ -71,7 +71,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- uses: mozilla-actions/[email protected]
- if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
name: Setup sccache secrets
run: echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
uses: mozilla-actions/[email protected]
- uses: metatypedev/setup-ghjk@318209a9d215f70716a4ac89dbeb9653a2deb8bc
- shell: bash
run: |
Expand Down Expand Up @@ -111,7 +115,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- uses: mozilla-actions/[email protected]
- if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
name: Setup sccache secrets
run: echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
uses: mozilla-actions/[email protected]
- uses: metatypedev/setup-ghjk@318209a9d215f70716a4ac89dbeb9653a2deb8bc
with:
# temporary fix
Expand Down Expand Up @@ -223,7 +231,11 @@ jobs:
with:
detached: true
- uses: dsherret/rust-toolchain-file@v1
- uses: mozilla-actions/[email protected]
- if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
name: Setup sccache secrets
run: echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- if: ${{ env.AWS_ACCESS_KEY_ID != '' }}
uses: mozilla-actions/[email protected]
# - name: Cache deno dir
# uses: actions/cache@v4
# with:
Expand All @@ -245,6 +257,8 @@ jobs:
cache-disable: true
- shell: bash
run: |
# the big run
# we don't want bash sub shells to do ghjk_reload
# TODO: consider disabling ghjk_reload on non-interactive shells
# by default
Expand Down

0 comments on commit a3310f4

Please sign in to comment.