Skip to content

Commit 9b973b4

Browse files
fix: make unit test dependency setup deterministic (#528)
2 parents fb3c1eb + d3b9f1a commit 9b973b4

7 files changed

Lines changed: 25 additions & 6 deletions

File tree

.github/actions/setup-node-with-cache/action.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ runs:
2525
${{ runner.os }}-pnpm-store-
2626
2727
- name: "Install dependencies"
28-
run: pnpm install --frozen-lockfile
28+
run: pnpm install --frozen-lockfile --ignore-scripts
29+
shell: bash
30+
- name: "Building internal utilities"
31+
run: pnpm run build:internal-utils
2932
shell: bash

.github/workflows/Build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ jobs:
5555
restore-keys: |
5656
${{ runner.os }}-pnpm-store-
5757
- name: "Installing dependencies"
58-
run: pnpm install
58+
# Avoid running workspace lifecycle builds during install; the internal utilities are built once below.
59+
run: pnpm install --frozen-lockfile --ignore-scripts
60+
- name: "Building internal utilities"
61+
run: pnpm run build:internal-utils
5962
- name: "Running build for development"
6063
run: pnpm -r --filter='!native-widgets' --filter=$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '...[origin/main]'; else echo '**'; fi) run build
6164
env:

.github/workflows/BuildMpk.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ jobs:
3838
- name: "Setup pnpm"
3939
uses: pnpm/action-setup@a8198c4bff370c8506180b035930dea56dbd5288 # v5
4040
- name: "Installing dependencies"
41-
run: pnpm install
41+
# Avoid running workspace lifecycle builds during install; the internal utilities are built once below.
42+
run: pnpm install --frozen-lockfile --ignore-scripts
43+
- name: "Building internal utilities"
44+
run: pnpm run build:internal-utils
4245
- name: "Bumping version"
4346
id: bump_version
4447
run: |

.github/workflows/MarketplaceRelease.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ jobs:
3232
- name: "Setup pnpm"
3333
uses: pnpm/action-setup@a8198c4bff370c8506180b035930dea56dbd5288 # v5
3434
- name: "Installing dependencies"
35-
run: pnpm install
35+
# Avoid running workspace lifecycle builds during install; the internal utilities are built once below.
36+
run: pnpm install --frozen-lockfile --ignore-scripts
37+
- name: "Building internal utilities"
38+
run: pnpm run build:internal-utils
3639
- name: "Building native widgets and js actions"
3740
run: pnpm -r run release
3841
- name: "Updating Native Mobile Resources project"

.github/workflows/Release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ jobs:
6060
restore-keys: |
6161
${{ runner.os }}-pnpm-store-
6262
- name: "Installing dependencies"
63-
run: pnpm install
63+
# Avoid running workspace lifecycle builds during install; the internal utilities are built once below.
64+
run: pnpm install --frozen-lockfile --ignore-scripts
65+
- name: "Building internal utilities"
66+
run: pnpm run build:internal-utils
6467
- name: "Running release for production"
6568
run: pnpm -r --filter=$(if [ "${{ steps.files.outputs.global_files }}" = "" ] && ${{ github.event_name == 'pull_request' }}; then echo '...[origin/main]'; else echo '**'; fi) run release
6669
env:

.github/workflows/UnitTests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ jobs:
5454
restore-keys: |
5555
${{ runner.os }}-pnpm-store-
5656
- name: "Installing dependencies"
57-
run: pnpm install
57+
# Avoid running workspace lifecycle builds during install; the internal utilities are built once below.
58+
run: pnpm install --frozen-lockfile --ignore-scripts
59+
- name: "Building internal utilities"
60+
run: pnpm run build:internal-utils
5861
- name: "Linting code"
5962
run: pnpm -r --filter=${{ steps.variables.outputs.arg }} run lint
6063
- name: "Running unit tests"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"test:e2e:android": "pnpm -r run test:e2e:android",
2323
"test:e2e:ios": "pnpm -r run test:e2e:ios",
2424
"build": "pnpm -r run build",
25+
"build:internal-utils": "pnpm --filter @mendix/piw-utils-internal --filter @mendix/piw-native-utils-internal run build",
2526
"release": "pnpm -r run release",
2627
"release:marketplace": "pnpm -r run release:marketplace",
2728
"release-github:widget": "node ./scripts/release/createWidgetRelease.js",

0 commit comments

Comments
 (0)