99
1010env :
1111 NODE_ENV : development
12- NODE_VERSION : 22
12+ NODE_VERSION : 24.14.1
1313 PERCY_POSTINSTALL_BROWSER : " true"
1414 PERCY_LOGLEVEL : " debug"
1515 PERCY_PARALLEL_TOTAL : 2
@@ -23,14 +23,16 @@ jobs:
2323 - uses : actions/checkout@v4
2424 - id : generate_cache_key
2525 run : |
26- lock_hash="$(sha256sum package-lock.json | awk '{print $1}')"
27- echo "cache_key=node${NODE_VERSION}-deps-${lock_hash}" >> "$GITHUB_OUTPUT"
26+ lock_hash="$(sha256sum package-lock.json e2e/package-lock.json | sha256sum | awk '{print $1}')"
27+ echo "cache_key=node${NODE_VERSION}-deps-${lock_hash}-v2 " >> "$GITHUB_OUTPUT"
2828 outputs :
2929 cache_key : ${{ steps.generate_cache_key.outputs.cache_key }}
3030 build_and_cache_dependencies_if_needed :
3131 needs : generate_cache_key
3232 runs-on : ubuntu-latest
33- container : mcr.microsoft.com/playwright:v1.57.0-jammy
33+ container : mcr.microsoft.com/playwright:v1.57.0-jammy
34+ permissions :
35+ actions : write
3436 steps :
3537 - uses : actions/checkout@v4
3638 - uses : actions/setup-node@v4
4547 e2e/node_modules
4648 dist
4749 key : ${{ needs.generate_cache_key.outputs.cache_key }}
48- - run : npm ci
50+ - run : |
51+ npm ci
52+ npm run build
4953 if: steps.node_deps_restore_cache.outputs.cache-hit != 'true' || contains(github.event.pull_request.labels.*.name, 'build:clean')
5054 - name : Remove build:clean label (if present)
5155 if : contains(github.event.pull_request.labels.*.name, 'build:clean')
@@ -104,16 +108,10 @@ jobs:
104108 with :
105109 node-version : ${{ env.NODE_VERSION }}
106110 cache : npm
107- - uses : actions/cache/restore@v4
108- with :
109- path : |
110- node_modules
111- e2e/node_modules
112- dist
113- key : ${{ needs.build_and_cache_dependencies_if_needed.outputs.cache_key }}
114111 - run : |
115112 mkdir -p dist/reports/tests/
116113 npm ci
114+ npm run build
117115 npm run test
118116 - uses : codecov/codecov-action@v4
119117 if : always()
0 commit comments