Skip to content

Commit

Permalink
Merge pull request #790 from per1234/engines_node
Browse files Browse the repository at this point in the history
Use engines.node as source of version data for "actions/setup-node" action
  • Loading branch information
per1234 authored Oct 16, 2024
2 parents 88a0b28 + d964dd4 commit eb8c66f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ name: Check Markdown
env:
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
GO_VERSION: "1.17"
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 20.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
Expand Down Expand Up @@ -79,7 +77,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Initialize markdownlint-cli problem matcher
uses: xt0rted/markdownlint-problem-matcher@v3
Expand Down Expand Up @@ -112,7 +110,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/check-npm-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-npm-task.md
name: Check npm

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 20.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -72,7 +68,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down Expand Up @@ -105,7 +101,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/check-prettier-formatting-task.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-prettier-formatting-task.md
name: Check Prettier Formatting

env:
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 20.x

# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
on:
create:
Expand Down Expand Up @@ -245,7 +241,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
node-version-file: package.json

- name: Install Task
uses: arduino/setup-task@v2
Expand Down
2 changes: 2 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ If you want to run integration tests or work on documentation, you will also nee
- A working [Python](https://www.python.org/downloads/) environment, version 3.9 or later.
- [Poetry](https://python-poetry.org/docs/).
- [**Node.js** / **npm**](https://nodejs.org/en/download/) - Node.js dependencies management tool.
- The **Node.js** version in use is defined in the `engines.node` field of
[`package.json`](https://github.com/arduino/arduino-lint/blob/main/package.json).
- **** [**nvm**](https://github.com/nvm-sh/nvm#installing-and-updating) is recommended if you want to manage multiple
installations of **Node.js** on your system.

Expand Down
3 changes: 3 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"markdownlint-cli": "0.37.0",
"prettier": "3.3.3"
},
"engines": {
"node": "20.x"
},
"type": "module"
}

0 comments on commit eb8c66f

Please sign in to comment.