Skip to content

Commit

Permalink
Add Node.js setup support (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhikdps authored Dec 3, 2024
1 parent 48a7467 commit bf898c6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
other_names: |
docs
lint
node-version-file: .tool-versions

check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ on:
description: Command to run after test commands.
required: false
type: string
node-version-file:
default: ""
description: Path to the Node.js version file (e.g., `.tool-versions`)
required: false
type: string
# keep permissions at top level because this is a composite workflow
permissions:
checks: read
Expand Down Expand Up @@ -120,6 +125,12 @@ jobs:
cache: ${{ hashFiles('requirements.txt', 'pyproject.toml') && 'pip' || '' }}
python-version: ${{ matrix.python_version || '3.12' }}

- name: Set up Node.js
if: ${{ inputs.node-version-file != '' }}
uses: actions/setup-node@v3
with:
node-version-file: ${{ inputs.node-version-file }}

- name: Run pre
if: ${{ inputs.run_pre }}
run: ${{ inputs.run_pre }}
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.18.0

0 comments on commit bf898c6

Please sign in to comment.