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

Add a CI build for Node 20. #4333

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
OS: ubuntu-latest
- NodeVersion: 18
OS: ubuntu-latest
- NodeVersion: 16
OS: windows-latest
- NodeVersion: 20
OS: ubuntu-latest
- NodeVersion: 18
OS: windows-latest
name: Node.js v${{ matrix.NodeVersion }} (${{ matrix.OS }})
Expand Down
1,269 changes: 633 additions & 636 deletions build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions common/changes/@microsoft/rush/node-20_2023-09-18-18-57.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/ts-command-line",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/ts-command-line"
}
3 changes: 3 additions & 0 deletions libraries/rush-lib/src/cli/test/RushXCommandLine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Utilities } from '../../utilities/Utilities';
import { Rush } from '../../api/Rush';
import { RushConfiguration } from '../../api/RushConfiguration';
import { RushConfigurationProject } from '../../api/RushConfigurationProject';
import { NodeJsCompatibility } from '../../logic/NodeJsCompatibility';

import { RushXCommandLine } from '../RushXCommandLine';

Expand Down Expand Up @@ -74,6 +75,8 @@ describe(RushXCommandLine.name, () => {

// Mock console log
logMock = jest.spyOn(console, 'log');

jest.spyOn(NodeJsCompatibility, 'isLtsVersion', 'get').mockReturnValue(true);
});

afterEach(() => {
Expand Down
20 changes: 17 additions & 3 deletions libraries/ts-command-line/src/test/CommandLineParameter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,23 @@ describe(CommandLineParameter.name, () => {
const args: string[] = ['hello-world'];
process.env.ENV_COLOR = '[u';

await expect(
commandLineParser.executeWithoutErrorHandling(args)
).rejects.toThrowErrorMatchingSnapshot();
// TODO: When Node 18 support is removed, switch this to use
// ```
// await expect(
// commandLineParser.executeWithoutErrorHandling(args)
// ).rejects.toThrowErrorMatchingSnapshot();
// ```

let error: string | undefined;
try {
await commandLineParser.executeWithoutErrorHandling(args);
} catch (e) {
error = e.message;
}

expect(error).toMatch(
/^The \[u environment variable value looks like a JSON array but failed to parse: Unexpected token /
);
});

it('raises an error if env var value is json containing non-scalars', async () => {
Expand Down
3 changes: 2 additions & 1 deletion rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
* LTS schedule: https://nodejs.org/en/about/releases/
* LTS versions: https://nodejs.org/en/download/releases/
*/
"nodeSupportedVersionRange": ">=16.13.0 <17.0.0 || >=18.15.0 <19.0.0",
"nodeSupportedVersionRange": ">=16.13.0 <17.0.0 || >=18.15.0 <19.0.0 || >=20.6.1 <21.0.0",
"suppressNodeLtsWarning": true, // TODO: Remove when Node 20 goes LTS

/**
* If the version check above fails, Rush will display a message showing the current
Expand Down