Skip to content

Commit 7241dc4

Browse files
committed
minor #2865 Run JS tests under multiple JS versions, define .nvmrc to 22.6 (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- Run JS tests under multiple JS versions, define .nvmrc to 22.6 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> In a second PR, I want to be able to run TypeScript natively with Node.js, for `bin/*.js` scripts. This is doable with Node.js 22.6+ with `--experimental-strip-types example.ts` flag, see https://nodejs.org/en/learn/typescript/run-natively. I'm configuring the version through `.nvmrc` (related to https://github.com/nvm-sh/nvm) instead of specifying it in `package.json` `engines.node`, otherwise it became an hard requirement making us impossible to run Node.js <22 (making impossible to run our JS tests for different major Node.js releases like 18 and 20). Commits ------- 058599d Run JS tests under multiple JS versions, define .nvmrc to 22.6
2 parents cf88c44 + 058599d commit 7241dc4

File tree

6 files changed

+10
-0
lines changed

6 files changed

+10
-0
lines changed

.github/workflows/app-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535

3636
- uses: actions/setup-node@v4
3737
with:
38+
node-version-file: '.nvmrc'
3839
cache: 'yarn'
3940
cache-dependency-path: |
4041
yarn.lock

.github/workflows/code-quality.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- run: npm i -g corepack && corepack enable
2626
- uses: actions/setup-node@v4
2727
with:
28+
node-version-file: '.nvmrc'
2829
cache: 'yarn'
2930
- run: yarn --immutable
3031
- run: yarn ci

.github/workflows/dist-files-unbuilt.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- run: npm i -g corepack && corepack enable
2525
- uses: actions/setup-node@v4
2626
with:
27+
node-version-file: '.nvmrc'
2728
cache: 'yarn'
2829
cache-dependency-path: |
2930
yarn.lock

.github/workflows/release-on-npm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- run: npm i -g corepack && corepack enable
2525
- uses: actions/setup-node@v4
2626
with:
27+
node-version-file: '.nvmrc'
2728
cache: 'yarn'
2829
cache-dependency-path: |
2930
yarn.lock

.github/workflows/unit-tests.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,16 @@ jobs:
8787
8888
js:
8989
runs-on: ubuntu-latest
90+
strategy:
91+
fail-fast: false
92+
matrix:
93+
node-version: [ '18.x', '20.x', '22.x', '24.x' ]
9094
steps:
9195
- uses: actions/checkout@v4
9296
- run: npm i -g corepack && corepack enable
9397
- uses: actions/setup-node@v4
9498
with:
99+
node-version: ${{ matrix.node-version }}
95100
cache: 'yarn'
96101
cache-dependency-path: |
97102
yarn.lock

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.6

0 commit comments

Comments
 (0)