Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ./
Expand Down Expand Up @@ -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: ./
Expand Down Expand Up @@ -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 }}'
Expand Down Expand Up @@ -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]

Expand All @@ -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 }}
21 changes: 18 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ 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
run: |
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: ./
Expand All @@ -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: ./
Expand All @@ -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'
Expand Down Expand Up @@ -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: ./
Expand All @@ -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'
Expand Down Expand Up @@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be in the summary? so other restarts would still have it?

@DerDreschner DerDreschner Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary might run before the merge job started and leave the merge job without context. That's why I put it in there. Don't ask me why I know that. 😄 Restarts always have them, as the context is only being deleted when the tests succeed (and there is no more need to re-run the workflow).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleting it as a step that needs the summary and the merge succeeded would be another way of doing it. But having a separate "Delete context" job without having a "Create context" one seemed a bit inconsistent to me.

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
Expand Down
Loading