ci: control development and CI version of Node.js via .nvmrc (#11708)

This commit is contained in:
Piotr Kuczynski 2025-11-11 22:55:47 +01:00 committed by GitHub
parent 5a28729b2e
commit 5d02f06fcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 8 deletions

View File

@ -31,8 +31,8 @@ jobs:
src-or-tests: &src-or-tests
- *src
- .github/workflows/test/**/*
- .github/workflows/**/*
- .mocharc.json
- .nvmrc
- .nycrc.json
lint: &lint
@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
node-version-file: .nvmrc
- run: npm ci
- run: npm run lint
- run: npm run format:ci
@ -64,7 +64,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
node-version-file: .nvmrc
- run: npm ci
- run: npm run build
@ -76,7 +76,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
node-version-file: .nvmrc
- run: npm ci
- run: npm run compile
- uses: actions/upload-artifact@v4

View File

@ -22,7 +22,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v5
with:
node-version: 20
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci

View File

@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
node-version-file: .nvmrc
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run package

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
20

View File

@ -50,7 +50,17 @@ cd typeorm
git remote add upstream https://github.com/typeorm/typeorm.git
```
## Installing NPM Modules
## Node
You should have node installed in the version described in [.nvmrc](.nvmrc).
It is recommended to configure your OS to automatically switch to use this version whenever you enter project folder. This can be achieved in many ways:
* [`fnm`](https://github.com/Schniz/fnm)
* [`zsh-nvm`](https://github.com/lukechilds/zsh-nvm#auto-use)
* [`asdf`](https://asdf-vm.com) with `asdf-nodejs` plugin and [`legacy_version_file = true`](https://asdf-vm.com/manage/configuration.html#legacy-version-file) option
## Installing package dependencies
Install all TypeORM dependencies by running this command:
@ -89,7 +99,7 @@ You can copy this tar into your project and run `npm install ./typeorm-x.x.x.tgz
## Running Tests Locally
It is greatly appreciated if PRs that change code come with appropriate tests.
It is greatly appreciated if PRs that change code come with appropriate tests.
To create a new test, check the [relevant functional tests](https://github.com/typeorm/typeorm/tree/master/test/functional). Depending on the test, you may need to create a new test file or modify an existing one.