diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4982d0d322..5a8cabceff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,8 +65,24 @@ jobs: DISABLE_V8_COMPILE_CACHE: '1' run: yarn run postinstall + - name: Check for package.json changes + id: changed-package-json + uses: tj-actions/changed-files@v44 + with: + files: | + **/package.json + files_ignore: | + **/node_modules/** + - name: Unit Test - run: yarn run unit-test-changed + run: | + if [[ "${{ steps.changed-package-json.outputs.any_changed }}" == "true" ]]; then + echo "Running all unit tests because a package.json file changed." + yarn run unit-test + else + echo "Running changed unit tests." + yarn run unit-test-changed + fi env: BITGOJS_TEST_PASSWORD: ${{ secrets.BITGOJS_TEST_PASSWORD }} @@ -208,7 +224,7 @@ jobs: - name: Install Packages if: steps.lerna-cache.outputs.cache-hit != 'true' || contains( github.event.pull_request.labels.*.name, 'SKIP_CACHE') - run: yarn install --with-frozen-lockfile + run: yarn install --frozen-lockfile - name: build packages if: steps.lerna-cache.outputs.cache-hit == 'true' diff --git a/.github/workflows/test_package_updates.yml b/.github/workflows/test_package_updates.yml deleted file mode 100644 index 5da334e339..0000000000 --- a/.github/workflows/test_package_updates.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Package updates - -on: - push: - branches: - - master - paths: - - '*/**/package.json' - - '!*/**/node_modules/package.json' - - 'package.json' - - '!node_modules/package.json' - pull_request: - branches: - - master - - rel/** - paths: - - '*/**/package.json' - - '!*/**/node_modules/package.json' - - 'package.json' - - '!node_modules/package.json' - -jobs: - unit-test-all: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - node-version: [18.x, 20.x, 22.x] - - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Setup node:${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - - name: Fetch Base Ref - run: git fetch origin $GITHUB_BASE_REF - - - name: Remove yarn.lock to simulate downstream installs - run: rm yarn.lock - - - name: Install Packages - env: - # Workaround for https://github.com/nodejs/node/issues/51555 - DISABLE_V8_COMPILE_CACHE: '1' - run: yarn install - - - name: Unit test all - run: yarn unit-test - env: - BITGOJS_TEST_PASSWORD: ${{ secrets.BITGOJS_TEST_PASSWORD }} diff --git a/modules/deser-lib/test/unit/deser-lib.ts b/modules/deser-lib/test/unit/deser-lib.ts index 885a37b993..92b2b295ed 100644 --- a/modules/deser-lib/test/unit/deser-lib.ts +++ b/modules/deser-lib/test/unit/deser-lib.ts @@ -1,4 +1,4 @@ -import { Cbor } from '../..'; +import { Cbor } from '../../src'; import * as cborFixtures from '../cbor/fixtures.json'; describe('deser-lib', function () { diff --git a/modules/utxo-bin/.eslintrc.json b/modules/utxo-bin/.eslintrc.json index 8cc685ce4c..bbc73b4e08 100644 --- a/modules/utxo-bin/.eslintrc.json +++ b/modules/utxo-bin/.eslintrc.json @@ -2,6 +2,17 @@ "extends": "../../.eslintrc.json", "rules": { "@typescript-eslint/explicit-module-boundary-types": "error", + "import/no-internal-modules": [ + "error", + { + // these are false-positives + // certain packages explicitly ALLOW deep imports via the `exports` directive in package.json + "allow": [ + "@bitgo/utxo-core/*", + "@noble/curves/*" + ] + } + ], "indent": "off" } } diff --git a/modules/utxo-bin/package.json b/modules/utxo-bin/package.json index e601d8ab67..b19df53f46 100644 --- a/modules/utxo-bin/package.json +++ b/modules/utxo-bin/package.json @@ -29,6 +29,7 @@ "@bitgo/blockapis": "^1.10.18", "@bitgo/statics": "^54.5.0", "@bitgo/unspents": "^0.48.3", + "@bitgo/utxo-core": "^1.11.0", "@bitgo/utxo-lib": "^11.6.1", "@bitgo/wasm-miniscript": "2.0.0-beta.7", "@noble/curves": "1.8.1",