From cb73516bebfbcea1b4e9975a86ef63edab103159 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 9 Mar 2022 18:43:29 -0500 Subject: [PATCH 1/8] chore: add --changedSince to CI test runs on other Node.js versions --- .github/workflows/ci.yml | 23 ++++++++++++------- .../tests/rules/unified-signatures.test.ts | 1 + 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3131ab968e63..18839205dc43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -240,7 +240,14 @@ jobs: # Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -' steps: + - name: Populate base SHA in local history + uses: actions/checkout@v3 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.base.sha }} + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: @@ -269,42 +276,42 @@ jobs: yarn build --exclude website - name: Run unit tests for typescript-estree - run: npx nx test @typescript-eslint/typescript-estree + run: npx nx test @typescript-eslint/typescript-estree --changedSince=${{ github.event.pull_request.base.sha }} env: CI: true - name: Run unit tests for visitor-keys - run: npx nx test @typescript-eslint/visitor-keys + run: npx nx test @typescript-eslint/visitor-keys --changedSince=${{ github.event.pull_request.base.sha }} env: CI: true - name: Run unit tests for scope-manager - run: npx nx test @typescript-eslint/scope-manager + run: npx nx test @typescript-eslint/scope-manager --changedSince=${{ github.event.pull_request.base.sha }} env: CI: true - name: Run unit tests for utils - run: npx nx test @typescript-eslint/utils + run: npx nx test @typescript-eslint/utils --changedSince=${{ github.event.pull_request.base.sha }} env: CI: true - name: Run unit tests for type-utils - run: npx nx test @typescript-eslint/type-utils + run: npx nx test @typescript-eslint/type-utils --changedSince=${{ github.event.pull_request.base.sha }} env: CI: true - name: Run unit tests for parser - run: npx nx test @typescript-eslint/parser + run: npx nx test @typescript-eslint/parser --changedSince=${{ github.event.pull_request.base.sha }} env: CI: true - name: Run unit tests for eslint-plugin - run: npx nx test @typescript-eslint/eslint-plugin + run: npx nx test @typescript-eslint/eslint-plugin --changedSince=${{ github.event.pull_request.base.sha }} env: CI: true - name: Run unit tests for eslint-plugin-tslint - run: npx nx test @typescript-eslint/eslint-plugin-tslint + run: npx nx test @typescript-eslint/eslint-plugin-tslint --changedSince=${{ github.event.pull_request.base.sha }} env: CI: true diff --git a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts index ea259aea4325..07da38b43c8d 100644 --- a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts +++ b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts @@ -4,6 +4,7 @@ import { RuleTester } from '../RuleTester'; //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ +// comment for CI change :) const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser' }); From 86bb14f9baf07f429cdfc5b988e9e8c7cc39396d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 9 Mar 2022 18:47:51 -0500 Subject: [PATCH 2/8] chore: add --changedSince to CI test runs on other Node.js versions --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18839205dc43..804f33e100b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -247,6 +247,8 @@ jobs: ref: ${{ github.event.pull_request.base.sha }} - uses: actions/checkout@v3 + with: + fetch-depth: 2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 From 9d6d0e40acca0eca9d4949ab2be4524cba2ba7ec Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 9 Mar 2022 18:53:54 -0500 Subject: [PATCH 3/8] chore: remove unnecessary tests comment from unified-signatures --- .../eslint-plugin/tests/rules/unified-signatures.test.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts index 07da38b43c8d..746d6259c79e 100644 --- a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts +++ b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts @@ -1,11 +1,6 @@ import rule from '../../src/rules/unified-signatures'; import { RuleTester } from '../RuleTester'; -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ -// comment for CI change :) - const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser' }); ruleTester.run('unified-signatures', rule, { From d1673b41627b8cd15d64ba7a0d03747478991529 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 10 Mar 2022 07:33:04 -0500 Subject: [PATCH 4/8] chore: reduce to just eslint-plugin --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 804f33e100b3..20df296b7545 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -278,32 +278,32 @@ jobs: yarn build --exclude website - name: Run unit tests for typescript-estree - run: npx nx test @typescript-eslint/typescript-estree --changedSince=${{ github.event.pull_request.base.sha }} + run: npx nx test @typescript-eslint/typescript-estree env: CI: true - name: Run unit tests for visitor-keys - run: npx nx test @typescript-eslint/visitor-keys --changedSince=${{ github.event.pull_request.base.sha }} + run: npx nx test @typescript-eslint/visitor-keys env: CI: true - name: Run unit tests for scope-manager - run: npx nx test @typescript-eslint/scope-manager --changedSince=${{ github.event.pull_request.base.sha }} + run: npx nx test @typescript-eslint/scope-manager env: CI: true - name: Run unit tests for utils - run: npx nx test @typescript-eslint/utils --changedSince=${{ github.event.pull_request.base.sha }} + run: npx nx test @typescript-eslint/utils env: CI: true - name: Run unit tests for type-utils - run: npx nx test @typescript-eslint/type-utils --changedSince=${{ github.event.pull_request.base.sha }} + run: npx nx test @typescript-eslint/type-utils env: CI: true - name: Run unit tests for parser - run: npx nx test @typescript-eslint/parser --changedSince=${{ github.event.pull_request.base.sha }} + run: npx nx test @typescript-eslint/parser env: CI: true @@ -313,7 +313,7 @@ jobs: CI: true - name: Run unit tests for eslint-plugin-tslint - run: npx nx test @typescript-eslint/eslint-plugin-tslint --changedSince=${{ github.event.pull_request.base.sha }} + run: npx nx test @typescript-eslint/eslint-plugin-tslint env: CI: true From 6362806aa77d2fbc10887d5895fae64dbb7607cc Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 10 Mar 2022 07:57:54 -0500 Subject: [PATCH 5/8] chore: try one-liner to fetch commits from origin --- .github/workflows/ci.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20df296b7545..19329f3c2cb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -240,16 +240,13 @@ jobs: # Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -' steps: - - name: Populate base SHA in local history - uses: actions/checkout@v3 - with: - fetch-depth: 1 - ref: ${{ github.event.pull_request.base.sha }} - - uses: actions/checkout@v3 with: fetch-depth: 2 + - name: Fetch commits after base SHA + run: git log main.. --pretty="%H" | xargs -n1 git fetch origin ${{ github.event.pull_request.base.sha }} + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: From 0b209186e0431ed71045ccbb3aea0ea12d28630a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 10 Mar 2022 08:09:56 -0500 Subject: [PATCH 6/8] chore: add back populating base SHA --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19329f3c2cb6..c3802a47b7f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -240,6 +240,12 @@ jobs: # Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -' steps: + - name: Populate base SHA in local history + uses: actions/checkout@v3 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.base.sha }} + - uses: actions/checkout@v3 with: fetch-depth: 2 From 7e21221adbed8835e81d336b5d0d947df40d2b8e Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 10 Mar 2022 08:17:41 -0500 Subject: [PATCH 7/8] chore: fix pulling base SHA --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3802a47b7f5..5ad4179f32f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -250,8 +250,13 @@ jobs: with: fetch-depth: 2 + - name: Print debug Git info + run: | + git remote -v + git log + - name: Fetch commits after base SHA - run: git log main.. --pretty="%H" | xargs -n1 git fetch origin ${{ github.event.pull_request.base.sha }} + run: git log ${{ github.event.pull_request.base.sha }}.. --pretty="%H" | xargs -n1 git fetch origin - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 From 8ddf5125860ab17bb2722c4c85a6efa1a1cfc9e8 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 10 Mar 2022 08:24:46 -0500 Subject: [PATCH 8/8] chore: try pulling instead of fetching --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ad4179f32f9..3928ae2aa3bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -255,8 +255,8 @@ jobs: git remote -v git log - - name: Fetch commits after base SHA - run: git log ${{ github.event.pull_request.base.sha }}.. --pretty="%H" | xargs -n1 git fetch origin + - name: Pull commits after base SHA + run: git log ${{ github.event.pull_request.base.sha }}.. --pretty="%H" | xargs -n1 git pull origin - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3