Skip to content

Commit be3fc5a

Browse files
chore: setup powerpack fs-shared-cache (#3630)
The `NX_REJECT_UNKNOWN_LOCAL_CACHE` environment variable is deprecated and won't work for much longer, unfortunately. Nx powerpack has a similar feature.
1 parent 0034bc0 commit be3fc5a

File tree

8 files changed

+250
-2
lines changed

8 files changed

+250
-2
lines changed

.github/renovate.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"extends": ["config:recommended", "config:js-lib", "group:linters", "group:test"],
44
"timezone": "Europe/Amsterdam",
55
"schedule": ["every weekend"],
6+
"configMigration": true,
67
"lockFileMaintenance": {
78
"enabled": true
89
},

.github/setup/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: 'Setup CI'
22
description: 'Set up npm, Java, and cache for CI'
3+
34
inputs:
45
node-version:
56
description: 'The Node.js version to use'
@@ -9,6 +10,9 @@ inputs:
910
description: 'Whether to set up Java'
1011
default: 'false'
1112
required: false
13+
powerpack-license:
14+
description: 'The license for the Nx Powerpack'
15+
required: true
1216
runs:
1317
using: 'composite'
1418
steps:
@@ -30,10 +34,13 @@ runs:
3034
- uses: actions/cache@v4
3135
with:
3236
path: .nx/cache
33-
key: ${{ runner.os }}-nx-${{ hashFiles('**/package-lock.json') }}
37+
key: ${{ runner.os }}-nx-${{ inputs.node-version }}-${{ hashFiles('**/package-lock.json') }}
3438
restore-keys: |
39+
${{ runner.os }}-nx-${{ inputs.node-version }}-
3540
${{ runner.os }}-nx-
36-
- run: echo "NX_REJECT_UNKNOWN_LOCAL_CACHE=0" >> $GITHUB_ENV
41+
- run: echo "NX_POWERPACK_LICENSE=${{ inputs.powerpack-license }}" >> $GITHUB_ENV
3742
shell: bash
3843
- run: npm ci
3944
shell: bash
45+
- run: npx nx activate-powerpack "${{ inputs.powerpack-license }}"
46+
shell: bash

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
with:
2424
node-version: ${{ matrix.node-version }}
2525
setup-java: true
26+
powerpack-license: ${{ secrets.NX_POWERPACK_LICENSE }}
2627
# Only install playwright if elements project is affected
2728
- name: affected
2829
id: affected
@@ -48,6 +49,8 @@ jobs:
4849
steps:
4950
- uses: actions/checkout@v4
5051
- uses: ./.github/setup
52+
with:
53+
powerpack-license: ${{ secrets.NX_POWERPACK_LICENSE }}
5154
- name: Install Playwright Browsers
5255
run: npx playwright install chromium --with-deps
5356
- run: npm run download-incremental-reports

.github/workflows/mutation-testing.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- uses: ./.github/setup
15+
with:
16+
powerpack-license: ${{ secrets.NX_POWERPACK_LICENSE }}
1517
- run: npx nx run metrics:stryker
1618
env:
1719
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
@@ -23,6 +25,8 @@ jobs:
2325
steps:
2426
- uses: actions/checkout@v4
2527
- uses: ./.github/setup
28+
with:
29+
powerpack-license: ${{ secrets.NX_POWERPACK_LICENSE }}
2630
- name: Install Playwright Browsers
2731
run: npx playwright install chromium --with-deps
2832
- name: Run Stryker
@@ -37,6 +41,7 @@ jobs:
3741
- uses: ./.github/setup
3842
with:
3943
setup-java: true
44+
powerpack-license: ${{ secrets.NX_POWERPACK_LICENSE }}
4045
- name: Run Stryker
4146
run: npx nx run metrics-scala:stryker
4247
env:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- uses: ./.github/setup
1818
with:
1919
setup-java: true
20+
powerpack-license: ${{ secrets.NX_POWERPACK_LICENSE }}
2021
- name: Set Release Env
2122
run: |
2223
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

.github/workflows/update-screenshots.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
with:
2020
token: ${{ steps.generate-token.outputs.token }}
2121
- uses: ./.github/setup
22+
with:
23+
powerpack-license: ${{ secrets.NX_POWERPACK_LICENSE }}
2224
- run: npx playwright install chromium firefox --with-deps
2325
- run: npx nx run-many --target=build
2426
- run: npx nx run elements:test:integration:update

package-lock.json

Lines changed: 227 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
},
3636
"homepage": "https://github.com/stryker-mutator/mutation-testing-elements#readme",
3737
"devDependencies": {
38+
"@nx/powerpack-license": "1.2.3",
39+
"@nx/powerpack-shared-fs-cache": "1.2.3",
3840
"@stryker-mutator/core": "8.7.1",
3941
"@stryker-mutator/mocha-runner": "8.7.1",
4042
"@stryker-mutator/typescript-checker": "8.7.1",

0 commit comments

Comments
 (0)