From 9bca81fc367ccc83654b57eff0129cd8f9edc3d5 Mon Sep 17 00:00:00 2001 From: David Dreschner Date: Wed, 8 Jul 2026 00:07:48 +0200 Subject: [PATCH] chore(e2e): Replace deprecate buildjet with native github cache Signed-off-by: David Dreschner --- .github/workflows/cypress.yml | 30 +++++++++++++----------------- .github/workflows/playwright.yml | 21 ++++++++++++++++++--- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index a819385947434..e8dab11cd7789 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -105,29 +105,19 @@ jobs: uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ steps.versions.outputs.nodeVersion }} + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Set up npm ${{ steps.versions.outputs.npmVersion }} run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' - - name: Restore npm cache - uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 - with: - path: ~/.npm - key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }} - - name: Install node dependencies & build app run: | npm ci TESTING=true npm run build --if-present - - name: Save npm cache - uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 - with: - path: ~/.npm - key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }} - - name: Save context - uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: key: cypress-context-${{ github.run_id }} path: ./ @@ -196,7 +186,7 @@ jobs: steps: - name: Restore context id: cache - uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: key: cypress-context-${{ github.run_id }} path: ./ @@ -224,6 +214,8 @@ jobs: uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ needs.init.outputs.nodeVersion }} + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Set up npm ${{ needs.init.outputs.npmVersion }} run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}' @@ -287,6 +279,10 @@ jobs: path: data.tar summary: + permissions: + contents: none + pull-requests: none + actions: write runs-on: ubuntu-latest-low needs: [init, cypress] @@ -298,8 +294,8 @@ jobs: - name: Summary status run: if ${{ needs.init.result != 'success' || ( needs.cypress.result != 'success' && needs.cypress.result != 'skipped' ) }}; then exit 1; fi - - name: Delete cache on success - uses: buildjet/cache-delete@7184288b8396c4492a56728c47dd286fbd1e96ae # v1 + - name: Delete context on success + uses: snnaplab/delete-branch-cache-action@20f7992a7b8b51aa719420d11b32c9d34a5eb362 # v1.0.0 if: needs.init.result == 'success' && needs.cypress.result == 'success' with: - cache_key: cypress-context-${{ github.run_id }} + key: cypress-context-${{ github.run_id }} diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index a4f203b690ed7..9bc39019886a3 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -62,6 +62,8 @@ jobs: uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ steps.versions.outputs.node-version }} + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Set up npm run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}' - name: Install dependencies and build @@ -69,7 +71,7 @@ jobs: npm ci npm run build --if-present - name: Save context - uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 + uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: key: playwright-context-${{ github.run_id }} path: ./ @@ -91,7 +93,7 @@ jobs: steps: - name: Restore context id: cache - uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: key: playwright-context-${{ github.run_id }} path: ./ @@ -112,6 +114,8 @@ jobs: uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: ${{ steps.versions.outputs.node-version }} + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Set up npm if: steps.cache.outputs.cache-hit != 'true' @@ -150,13 +154,16 @@ jobs: merge-reports: # Merge reports after playwright-tests, even if some shards have failed if: ${{ !cancelled() }} + permissions: + contents: none + actions: write needs: [gate, playwright-tests] runs-on: ubuntu-latest-low steps: - name: Restore context id: cache - uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 + uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: key: playwright-context-${{ github.run_id }} path: ./ @@ -170,6 +177,8 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' with: node-version: ${{ needs.playwright-tests.outputs.node-version }} + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Set up npm if: steps.cache.outputs.cache-hit != 'true' @@ -202,6 +211,12 @@ jobs: echo ' 1. Extract the folder from the zip file' echo ' 2. run "npx playwright show-report name-of-my-extracted-playwright-report"' + - name: Delete context on success + uses: snnaplab/delete-branch-cache-action@20f7992a7b8b51aa719420d11b32c9d34a5eb362 # v1.0.0 + if: needs.playwright-tests.result == 'success' + with: + key: playwright-context-${{ github.run_id }} + summary: permissions: contents: none