From a3310f4cc5debefbc0bbf21f2879b94c1440d6d1 Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:20:02 +0300 Subject: [PATCH] fix(ci): disable sccache when secrets not avail (#874) - 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 <56622350+Yohe-Am@users.noreply.github.com> --- .github/dependabot.yml | 4 ++-- .github/workflows/tests.yml | 32 +++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 598f12e2d3..ac1436916d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -19,7 +19,7 @@ updates: exclude-patterns: - "swc_*" - package-ecosystem: pip - directory: /typegraph + directory: /src/typegraph schedule: interval: monthly groups: @@ -35,7 +35,7 @@ updates: patterns: - "*" - package-ecosystem: npm - directory: /website + directory: /docs schedule: interval: monthly groups: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9db167d288..0a4d0e96fe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,7 @@ on: pull_request: types: - opened + - reopened - synchronize - ready_for_review @@ -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: @@ -71,7 +71,11 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dsherret/rust-toolchain-file@v1 - - uses: mozilla-actions/sccache-action@v0.0.5 + - 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/sccache-action@v0.0.5 - uses: metatypedev/setup-ghjk@318209a9d215f70716a4ac89dbeb9653a2deb8bc - shell: bash run: | @@ -111,7 +115,11 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dsherret/rust-toolchain-file@v1 - - uses: mozilla-actions/sccache-action@v0.0.5 + - 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/sccache-action@v0.0.5 - uses: metatypedev/setup-ghjk@318209a9d215f70716a4ac89dbeb9653a2deb8bc with: # temporary fix @@ -223,7 +231,11 @@ jobs: with: detached: true - uses: dsherret/rust-toolchain-file@v1 - - uses: mozilla-actions/sccache-action@v0.0.5 + - 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/sccache-action@v0.0.5 # - name: Cache deno dir # uses: actions/cache@v4 # with: @@ -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