From b06b1cb7b63153e4b94f1c05c8de64269e23abb5 Mon Sep 17 00:00:00 2001 From: Eric Li Date: Fri, 7 Feb 2025 12:31:04 -0500 Subject: [PATCH] feat(root): make unit-test-changed work on out of date branches BTC-0 TICKET: BTC-0 --- .github/workflows/ci.yml | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10e168e812..edf045afb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 - name: Setup node:${{ matrix.node-version }} uses: actions/setup-node@v2 @@ -86,7 +87,7 @@ jobs: fail-fast: false matrix: check: ['lint', 'format', 'commit-lint', 'dependencies'] - + steps: - uses: actions/checkout@v4 with: diff --git a/package.json b/package.json index 79bc352da9..544fbed06d 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "audit-dev": "yarn audit --group devDependencies ; test $? -lt 8", "lint": "lerna run lint --stream", "lint-changed": "lerna run lint --since origin/${GITHUB_REPO_BRANCH:-master}..HEAD --stream", - "unit-test-changed": "lerna run unit-test --since origin/${GITHUB_REPO_BRANCH:-master}..HEAD --stream", + "unit-test-changed": "lerna run unit-test --since $(git merge-base HEAD~ origin/${GITHUB_REPO_BRANCH:-master}) --stream", "browser-tests": "lerna run --scope bitgo compile && lerna run --scope bitgo browser-test && lerna run --scope @bitgo/web-demo test", "gen-coverage-changed": "lerna run gen-coverage --since origin/${GITHUB_REPO_BRANCH:-master}..HEAD --stream --parallel", "coverage-changed": "lerna run upload-coverage --since origin/${GITHUB_REPO_BRANCH:-master}..HEAD --stream --parallel --",