File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,15 @@ set -euo pipefail
66# Rebuild optional native bindings for the current platform without resolving new versions.
77npm rebuild --include=optional @pact-foundation/pact @pact-foundation/pact-core
88
9+ # CI runners can restore node_modules generated on a different architecture.
10+ # Ensure Pact's native prebuild for Linux x64 glibc is present before loading pact-core.
11+ if [[ " $( uname -s) " == " Linux" && " $( uname -m) " == " x86_64" ]]; then
12+ if ! node -e " require.resolve('@pact-foundation/pact-core-linux-x64-glibc')" > /dev/null 2>&1 ; then
13+ PACT_CORE_VERSION=" $( node -p " (() => { try { return require('@pact-foundation/pact/node_modules/@pact-foundation/pact-core/package.json').version; } catch { return require('@pact-foundation/pact-core/package.json').version; } })()" ) "
14+ npm install --no-save --include=optional " @pact-foundation/pact-core-linux-x64-glibc@${PACT_CORE_VERSION} "
15+ fi
16+ fi
17+
918# Remove old PACTs
1019rm -rf ./.pacts
1120
You can’t perform that action at this time.
0 commit comments