From d36ef5716a37fb709e3cc2126a092df6e2c09d0c Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 28 Aug 2024 09:07:48 +0200 Subject: [PATCH 1/2] ci: Store build output as artifacts instead of cache --- .github/actions/restore-cache/action.yml | 12 +++++------- .github/workflows/build.yml | 8 +++++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/actions/restore-cache/action.yml b/.github/actions/restore-cache/action.yml index 848983376840..316d89dc1c26 100644 --- a/.github/actions/restore-cache/action.yml +++ b/.github/actions/restore-cache/action.yml @@ -11,15 +11,13 @@ runs: path: ${{ env.CACHED_DEPENDENCY_PATHS }} key: ${{ env.DEPENDENCY_CACHE_KEY }} - - name: Check build cache - uses: actions/cache/restore@v4 - id: build-cache + - name: Restore build artifacts + uses: actions/download-artifact@v4 with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} + name: build-output - name: Check if caches are restored uses: actions/github-script@v6 - if: steps.dep-cache.outputs.cache-hit != 'true' || steps.build-cache.outputs.cache-hit != 'true' + if: steps.dep-cache.outputs.cache-hit != 'true' with: - script: core.setFailed('Dependency or build cache could not be restored - please re-run ALL jobs.') + script: core.setFailed('Dependency cache could not be restored - please re-run ALL jobs.') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37c3089f1d2e..591241950f73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,7 +162,6 @@ jobs: - name: Check build cache uses: actions/cache@v4 - id: cache_built_packages with: path: ${{ env.CACHED_BUILD_PATHS }} key: ${{ env.BUILD_CACHE_KEY }} @@ -188,6 +187,13 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: yarn build + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-output + path: ${{ env.CACHED_BUILD_PATHS }} + retention-days: 2 + outputs: dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }} changed_node_integration: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry-internal/node-integration-tests') }} From b84f8df0a9bd6dc5b8b3762fc46a289cdc31622e Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 28 Aug 2024 09:20:43 +0200 Subject: [PATCH 2/2] no more build cache --- .github/workflows/build.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 591241950f73..d0ae1a39c1d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,6 @@ env: ${{ github.workspace }}/packages/utils/cjs ${{ github.workspace }}/packages/utils/esm - BUILD_CACHE_KEY: build-cache-${{ github.event.inputs.commit || github.sha }} BUILD_CACHE_TARBALL_KEY: tarball-${{ github.event.inputs.commit || github.sha }} # GH will use the first restore-key it finds that matches @@ -160,12 +159,6 @@ jobs: base: ${{ github.event.pull_request.base.sha }} head: ${{ env.HEAD_COMMIT }} - - name: Check build cache - uses: actions/cache@v4 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: NX cache uses: actions/cache@v4 # Disable cache when: @@ -192,7 +185,9 @@ jobs: with: name: build-output path: ${{ env.CACHED_BUILD_PATHS }} - retention-days: 2 + retention-days: 7 + compression-level: 6 + overwrite: true outputs: dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}