From ac2b486a46c75d66c26e142b7f2eb107e752dcfb Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Tue, 10 May 2022 21:59:05 -0700 Subject: [PATCH 1/2] chore: improve CI by making it a workflow graph --- .github/actions/prepare-build/action.yml | 22 + .github/actions/prepare-install/action.yml | 39 ++ .github/workflows/ci.yml | 536 +++++------------- jest.config.base.js | 23 +- jest.preset.js | 15 - packages/ast-spec/jest.config.js | 4 - .../eslint-plugin-internal/jest.config.js | 1 - packages/eslint-plugin-tslint/jest.config.js | 1 - packages/eslint-plugin/jest.config.js | 2 - packages/scope-manager/jest.config.js | 13 +- packages/type-utils/jest.config.js | 1 - packages/types/jest.config.js | 1 - packages/utils/jest.config.js | 1 - packages/visitor-keys/jest.config.js | 1 - 14 files changed, 232 insertions(+), 428 deletions(-) create mode 100644 .github/actions/prepare-build/action.yml create mode 100644 .github/actions/prepare-install/action.yml delete mode 100644 jest.preset.js diff --git a/.github/actions/prepare-build/action.yml b/.github/actions/prepare-build/action.yml new file mode 100644 index 000000000000..a83f403c0ffc --- /dev/null +++ b/.github/actions/prepare-build/action.yml @@ -0,0 +1,22 @@ +name: "Prepare: Build" +description: "Prepares the repo for a job by running the build" +# inputs: - no inputs +# outputs: - no outputs + +runs: + using: "composite" + steps: + - uses: actions/cache@v3 + id: build-cache + with: + path: "**/dist/**" + key: ${{ runner.os }}-build-${{ github.ref }} + restore-keys: | + ${{ runner.os }}-build- + + # if the cache was hit - this will run in <1s + - name: Build + shell: bash + # Website will be built by the Netlify GitHub App + run: | + yarn build --exclude website diff --git a/.github/actions/prepare-install/action.yml b/.github/actions/prepare-install/action.yml new file mode 100644 index 000000000000..472661c62f2d --- /dev/null +++ b/.github/actions/prepare-install/action.yml @@ -0,0 +1,39 @@ +name: "Prepare: Checkout and Install" +description: "Prepares the repo for a job by checking out and installing dependencies" +inputs: + node-version: + description: "The node version to setup" + required: true +# outputs: - no outputs + +runs: + using: "composite" + steps: + - name: echo github.ref + shell: bash + run: echo ${{ github.ref }} + + - name: Use Node.js ${{ inputs.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ inputs.node-version }} + + - name: Get yarn cache directory path + shell: bash + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + # if the cache was hit - this will run in <1s + - name: Install dependencies + shell: bash + run: | + yarn --ignore-engines --frozen-lockfile --ignore-scripts + yarn check-clean-workspace-after-install diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e38c9b7f826b..ce2c0084847c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,419 +9,187 @@ on: - '**' env: - PRIMARY_NODE_VERSION: 12 + PRIMARY_NODE_VERSION: 18 NX_BRANCH: ${{ github.event.number }} NX_RUN_GROUP: ${{ github.run_id }} - # 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 12.x -' -jobs: - typecheck: - name: Typecheck - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: echo github.ref - run: echo ${{ github.ref }} - - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v3 - with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- +defaults: + run: + shell: bash - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install +# +# Workflow for how the CI spawns jobs: +# 1) Run the install and cache the install artefacts +# 2) Run the build and cache the output +# - In parallel we also any steps that don't need the build (like prettier) +# 3) Run the steps that depend on the build +# - - name: Build - run: | - # Website will be built by the Netlify GitHub App - yarn build --exclude website - - # Note that this command *also* type checks tests/tools, - # whereas the build only checks src files - - name: Typecheck all packages - run: yarn typecheck - - unit_test_on_primary_node_version: - name: Unit tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: echo github.ref - run: echo ${{ github.ref }} - - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v3 - with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install - - - name: Build - run: | - # Website will be built by the Netlify GitHub App - yarn build --exclude website - - - name: Run unit tests for ast-spec - run: yarn test - working-directory: packages/ast-spec - env: - CI: true - - - name: Run unit tests for typescript-estree - 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 - env: - CI: true - - - name: Run unit tests for scope-manager - run: npx nx test @typescript-eslint/scope-manager --code-coverage - env: - CI: true - - - name: Run unit tests for utils - 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 - env: - CI: true - - - name: Run unit tests for parser - run: npx nx test @typescript-eslint/parser - env: - CI: true - - - name: Run unit tests for eslint-plugin - run: npx nx test @typescript-eslint/eslint-plugin - env: - CI: true - - - name: Run unit tests for eslint-plugin-tslint - run: npx nx test @typescript-eslint/eslint-plugin-tslint - env: - CI: true - - - name: Run unit tests for eslint-plugin-internal - run: npx nx test @typescript-eslint/eslint-plugin-internal - env: - CI: true - - - name: Publish code coverage report - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: packages/**/coverage/lcov.info - flags: unittest - name: codecov - - spellcheck: - name: Spellcheck +jobs: + install: + name: Checkout and Install runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install + uses: ./.github/actions/prepare-install with: node-version: ${{ env.PRIMARY_NODE_VERSION }} - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install - - - name: Check spelling - run: yarn check-spelling - - check_format: - name: Check Format + build: + name: Build All Packages + needs: [install] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install + uses: ./.github/actions/prepare-install with: node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Build + uses: ./.github/actions/prepare-build - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install - - - name: Lint markdown - run: yarn lint-markdown - - markdownlint: - name: Markdownlint + lint_without_build: + name: Lint + needs: [install] runs-on: ubuntu-latest + strategy: + matrix: + lint-task: [ + "check-spelling", + "check-format", + "lint-markdown", + ] steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install + uses: ./.github/actions/prepare-install with: node-version: ${{ env.PRIMARY_NODE_VERSION }} - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install + - name: Run Check + run: yarn ${{ matrix.lint-task }} - - name: Check code formatting - run: yarn check-format - - eslint: - name: ESLint + lint_with_build: + name: Lint + # because we lint with our own tooling, we need to build + needs: [build] runs-on: ubuntu-latest + strategy: + matrix: + lint-task: [ + "lint", + "typecheck", + ] steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install + uses: ./.github/actions/prepare-install with: node-version: ${{ env.PRIMARY_NODE_VERSION }} - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install - - name: Build - run: | - # Website will be built by the Netlify GitHub App - yarn build --exclude website + uses: ./.github/actions/prepare-build - - name: Lint code - run: yarn lint + - name: Run Check + run: yarn ${{ matrix.lint-task }} integration_tests: name: Run integration tests on primary Node.js version + needs: [build] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install + uses: ./.github/actions/prepare-install with: node-version: ${{ env.PRIMARY_NODE_VERSION }} - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install - - name: Build - run: | - # Website will be built by the Netlify GitHub App - yarn build --exclude website + uses: ./.github/actions/prepare-build - name: Run integrations tests run: yarn test-integration env: CI: true - unit_tests_on_other_node_versions: - name: Run unit tests on other Node.js versions + unit_tests: + name: Run Unit Tests + needs: [build] runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x, 16.x] + # just run on the oldest and latest supported versions and assume the intermediate versions are good + node-version: [12, 18] + package: [ + "ast-spec", + "eslint-plugin", + "eslint-plugin-internal", + "eslint-plugin-tslint", + "parser", + "scope-manager", + "type-utils", + "typescript-estree", + "utils", + "visitor-keys", + ] env: # 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 }} -' + COLLECT_COVERAGE: false steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 with: - node-version: ${{ matrix.node-version }} - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + fetch-depth: 2 + - name: Install + uses: ./.github/actions/prepare-install with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install - + node-version: ${{ env.PRIMARY_NODE_VERSION }} - name: Build - run: | - # Website will be built by the Netlify GitHub App - yarn build --exclude website - - - name: Run unit tests for typescript-estree - 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 - env: - CI: true - - - name: Run unit tests for scope-manager - run: npx nx test @typescript-eslint/scope-manager - env: - CI: true - - - name: Run unit tests for utils - 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 - env: - CI: true - - - name: Run unit tests for parser - run: npx nx test @typescript-eslint/parser - env: - CI: true - - - name: Run unit tests for eslint-plugin - run: npx nx test @typescript-eslint/eslint-plugin + uses: ./.github/actions/prepare-build + + # collect coverage on the primary node version + # we don't collect coverage on other node versions so they run faster + # note that we don't do this as a single `run` with a flag because some + # packages don't collect coverage on purpose, so forcing `--coverage=true` + # would override the config + - name: Run unit tests with coverage for ${{ matrix.package }} + if: env.PRIMARY_NODE_VERSION == matrix.node-version + run: npx nx test @typescript-eslint/${{ matrix.package }} env: CI: true - - - name: Run unit tests for eslint-plugin-tslint - run: npx nx test @typescript-eslint/eslint-plugin-tslint + - name: Run unit tests for ${{ matrix.package }} + if: env.PRIMARY_NODE_VERSION != matrix.node-version + run: npx nx test @typescript-eslint/${{ matrix.package }} --coverage=false env: CI: true - # ast-spec is internal only - so don't care about compat on other versions - # eslint-plugin-internal is internal only - so don't care about compat on other versions + - name: Store coverage for uploading + if: env.PRIMARY_NODE_VERSION == matrix.node-version + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.package }}-coverage + path: packages/${{ matrix.package }}/coverage/lcov.info website_tests: name: Website tests + needs: [build] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 with: fetch-depth: 2 - - - name: echo github.ref - run: echo ${{ github.ref }} - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + - name: Install + uses: ./.github/actions/prepare-install with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: yarn --ignore-engines --frozen-lockfile + node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Build + uses: ./.github/actions/prepare-build - name: Cypress run uses: cypress-io/github-action@v2 @@ -430,62 +198,58 @@ jobs: start: yarn start - uses: actions/upload-artifact@v3 - if: always() with: name: screenshots path: | packages/website/cypress/screenshots/ packages/website/cypress/videos/ + upload_coverage: + name: Upload Codecov Coverage + needs: [unit_tests] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Download coverage reports + uses: actions/download-artifact@v3 + with: + path: coverage + + - name: Publish code coverage report + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/**/lcov.info + flags: unittest + name: codecov + publish_canary_version: name: Publish the latest code as a canary version runs-on: ubuntu-latest needs: [ - typecheck, - unit_test_on_primary_node_version, - unit_tests_on_other_node_versions, - spellcheck, - check_format, - markdownlint, - eslint, integration_tests, + lint_with_build, + lint_without_build, + unit_tests, ] if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v3 - # Fetch all history for all tags and branches in this job because lerna needs it - - run: | - git fetch --prune --unshallow - - - name: Use Node.js ${{ env.PRIMARY_NODE_VERSION }} - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install + uses: ./.github/actions/prepare-install with: node-version: ${{ env.PRIMARY_NODE_VERSION }} - registry-url: https://registry.npmjs.org/ - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: | - yarn --ignore-engines --frozen-lockfile --ignore-scripts - yarn check-clean-workspace-after-install - - name: Build - run: | - # Website will be built by the Netlify GitHub App - yarn build --exclude website + uses: ./.github/actions/prepare-build + + # Fetch all history for all tags and branches in this job because lerna needs it + - run: | + git fetch --prune --unshallow - name: Publish all packages to npm run: npx lerna publish --loglevel=verbose --canary --exact --force-publish --yes diff --git a/jest.config.base.js b/jest.config.base.js index 4470c1be07b9..b94573bf7196 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -3,17 +3,34 @@ // @ts-check /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { - collectCoverage: false, + collectCoverage: true, collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], - coverageReporters: ['text-summary', 'lcov'], - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + coverageReporters: ['lcov'], + moduleFileExtensions: [ + 'ts', + 'tsx', + 'mts', + 'mtsx', + 'js', + 'jsx', + 'mjs', + 'mjsx', + 'json', + 'node', + ], resolver: '/../../tests/jest-resolver.js', + testRegex: ['./tests/.+\\.test\\.ts$', './tests/.+\\.spec\\.ts$'], transform: { '^.+\\.(t|j)sx?$': [ '@swc/jest', { jsc: { target: 'es2019', + transform: { + react: { + runtime: 'automatic', + }, + }, }, }, ], diff --git a/jest.preset.js b/jest.preset.js deleted file mode 100644 index 3d08453c18d0..000000000000 --- a/jest.preset.js +++ /dev/null @@ -1,15 +0,0 @@ -// @ts-check - -/* eslint-disable import/no-extraneous-dependencies */ -/* eslint-disable @typescript-eslint/no-unsafe-assignment */ - -'use strict'; - -/** @type {import('@nrwl/jest/preset/jest-preset')} */ -const nxPreset = require('@nrwl/jest/preset'); - -const { transform: _ignoredTsJestTransform, ...configToUse } = nxPreset; - -module.exports = { - ...configToUse, -}; diff --git a/packages/ast-spec/jest.config.js b/packages/ast-spec/jest.config.js index ac3b63608b7a..eeae64cb5dd4 100644 --- a/packages/ast-spec/jest.config.js +++ b/packages/ast-spec/jest.config.js @@ -4,10 +4,6 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), - testRegex: ['./tests/.+\\.test\\.ts$'], collectCoverage: false, - collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], - coverageReporters: ['text-summary', 'lcov'], setupFilesAfterEnv: ['./tests/util/setupJest.ts'], }; diff --git a/packages/eslint-plugin-internal/jest.config.js b/packages/eslint-plugin-internal/jest.config.js index 5f1ea3f4bcb0..910991b20cff 100644 --- a/packages/eslint-plugin-internal/jest.config.js +++ b/packages/eslint-plugin-internal/jest.config.js @@ -4,5 +4,4 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), - testRegex: './tests/.+\\.test\\.ts$', }; diff --git a/packages/eslint-plugin-tslint/jest.config.js b/packages/eslint-plugin-tslint/jest.config.js index 821770114b26..910991b20cff 100644 --- a/packages/eslint-plugin-tslint/jest.config.js +++ b/packages/eslint-plugin-tslint/jest.config.js @@ -4,5 +4,4 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), - testRegex: './tests/.+\\.spec\\.ts$', }; diff --git a/packages/eslint-plugin/jest.config.js b/packages/eslint-plugin/jest.config.js index 1f9cdcdecd92..910991b20cff 100644 --- a/packages/eslint-plugin/jest.config.js +++ b/packages/eslint-plugin/jest.config.js @@ -4,6 +4,4 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), - testRegex: './tests/.+\\.test\\.ts$', - coverageReporters: ['text-summary', 'lcov'], }; diff --git a/packages/scope-manager/jest.config.js b/packages/scope-manager/jest.config.js index ccaa4a6999bb..9148e4d46fb7 100644 --- a/packages/scope-manager/jest.config.js +++ b/packages/scope-manager/jest.config.js @@ -1,19 +1,8 @@ 'use strict'; // @ts-check - /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { - displayName: 'scope-manager', - preset: '../../jest.preset.js', - testEnvironment: 'node', - transform: { - '^.+\\.[tj]sx?$': [ - '@swc/jest', - { jsc: { transform: { react: { runtime: 'automatic' } } } }, - ], - }, - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], - coverageDirectory: '/coverage', + ...require('../../jest.config.base.js'), setupFilesAfterEnv: ['./tests/util/serializers/index.ts'], }; diff --git a/packages/type-utils/jest.config.js b/packages/type-utils/jest.config.js index 5f1ea3f4bcb0..910991b20cff 100644 --- a/packages/type-utils/jest.config.js +++ b/packages/type-utils/jest.config.js @@ -4,5 +4,4 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), - testRegex: './tests/.+\\.test\\.ts$', }; diff --git a/packages/types/jest.config.js b/packages/types/jest.config.js index 77fe4d022a95..910991b20cff 100644 --- a/packages/types/jest.config.js +++ b/packages/types/jest.config.js @@ -4,5 +4,4 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), - testRegex: ['./tests/.+\\.test\\.ts$'], }; diff --git a/packages/utils/jest.config.js b/packages/utils/jest.config.js index 5f1ea3f4bcb0..910991b20cff 100644 --- a/packages/utils/jest.config.js +++ b/packages/utils/jest.config.js @@ -4,5 +4,4 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), - testRegex: './tests/.+\\.test\\.ts$', }; diff --git a/packages/visitor-keys/jest.config.js b/packages/visitor-keys/jest.config.js index 77fe4d022a95..910991b20cff 100644 --- a/packages/visitor-keys/jest.config.js +++ b/packages/visitor-keys/jest.config.js @@ -4,5 +4,4 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), - testRegex: ['./tests/.+\\.test\\.ts$'], }; From f45de7e17a63bba2210efcf7120e9cbd8bf4307c Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 18 May 2022 11:58:39 -0700 Subject: [PATCH 2/2] change codecov retention to 1 day --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce2c0084847c..05d9a6b452f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,6 +174,8 @@ jobs: with: name: ${{ matrix.package }}-coverage path: packages/${{ matrix.package }}/coverage/lcov.info + # Sadly 1 day is the minimum + retention-days: 1 website_tests: name: Website tests