diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d255f68..d496d95 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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() diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index eda4d93..8c1ce51 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -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 @@ -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 }} diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..f31e6b0 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 20.18.0