Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add regression testing against old TS and ESLint versions in the CI #5573

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -26,6 +26,7 @@ module.exports = {
'./tsconfig.eslint.json',
'./packages/*/tsconfig.json',
'./tests/integration/tsconfig.json',
'./tools/tsconfig.json',
/**
* We are currently in the process of transitioning to nx's out of the box structure and
* so need to manually specify converted packages' tsconfig.build.json and tsconfig.spec.json
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -11,7 +11,9 @@ on:
merge_group:

env:
PRIMARY_ESLINT_VERSION: '^8.0.0'
PRIMARY_NODE_VERSION: 18
PRIMARY_TYPESCRIPT_VERSION: '~4.8.0'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side note that i hate that this is yet another thing for us to remember to keep in sync.

# Only set the read-write token if we are on the main branch
NX_CLOUD_ACCESS_TOKEN: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.NX_CLOUD_ACCESS_TOKEN }}

Expand Down Expand Up @@ -61,6 +63,7 @@ jobs:
needs: [install]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lint-task: ['check-spelling', 'check-format', 'lint-markdown']
steps:
Expand All @@ -80,6 +83,7 @@ jobs:
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
lint-task: ['lint', 'typecheck']
steps:
Expand Down Expand Up @@ -119,8 +123,10 @@ jobs:
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# just run on the oldest and latest supported versions and assume the intermediate versions are good
# unfortunately you can't reference environment variables in an array :(
node-version: [14, 18]
package:
[
Expand Down Expand Up @@ -176,6 +182,104 @@ jobs:
# Sadly 1 day is the minimum
retention-days: 1

unit_tests_ts_regression:
name: Run Unit Tests (TypeScript Version Regression Checks)
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
# note that we don't regression test all packages here on purpose because most don't depend on TS directly.
['eslint-plugin', 'scope-manager', 'type-utils', 'typescript-estree']

ts-version:
# unfortunately you can't reference environment variables in an array :(
[
# lowest possible version
'4.2.4',
# somewhere in the middle for sanity check
'~4.5.5',
# highest possible version
'~4.8.2',
]
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:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
uses: ./.github/actions/prepare-build

- name: Install Specific TS Version
run: |
yarn ts-node ./tools/change-ts-version.ts ${{ matrix.ts-version }}
yarn --ignore-engines --ignore-scripts

- name: Patch Packages
if: matrix.ts-version == env.PRIMARY_TYPESCRIPT_VERSION
run: |
yarn patch-package

# we don't collect coverage for these tests on purpose
- name: Run unit tests for ${{ matrix.package }}
run: npx nx test ${{ matrix.package }} --coverage=false
env:
CI: true

unit_tests_eslint_regression:
name: Run Unit Tests (ESLint Version Regression Checks)
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
# note that we don't regression test all packages here on purpose because most don't depend on ESLint directly.
['eslint-plugin', 'utils']
eslint-version:
# unfortunately you can't reference environment variables in an array :(
[
# lowest possible version
'6.0.0',
# somewhere in the middle for sanity check
'7.32.0',
# highest possible version
'^8.0.0',
]
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:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
uses: ./.github/actions/prepare-build

- name: Install Specific ESLint Version
run: yarn add -DW --ignore-engines --ignore-scripts eslint@${{ matrix.eslint-version }}

# we don't collect coverage for these tests on purpose
- name: Run unit tests for ${{ matrix.package }}
run: npx nx test ${{ matrix.package }} --coverage=false
env:
CI: true

website_tests:
permissions:
contents: read # to fetch code (actions/checkout)
Expand Down
2 changes: 2 additions & 0 deletions packages/ast-spec/package.json
Expand Up @@ -48,12 +48,14 @@
"@babel/parser": "*",
"@microsoft/api-extractor": "^7.23.2",
"@types/babel__core": "*",
"eslint": "*",
"glob": "*",
"jest-diff": "*",
"jest-snapshot": "*",
"jest-specific-snapshot": "*",
"make-dir": "*",
"pretty-format": "*",
"semver": "*",
"typescript": "*"
}
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}
@@ -0,0 +1,3 @@
{
"typescript": ">=4.9"
}