Skip to content

As a developer, I need our branch-cicd workflow to target the same version of Node.js that we specify in .nvmrcΒ #152

@anilnatha

Description

@anilnatha

Checked for duplicates

No - I haven't checked

πŸ§‘β€πŸ”¬ User Persona(s)

PDS Engineer

πŸ’ͺ Motivation

so that our branch integration workflow accurately reflects test building against the same version we have developed against.

πŸ“– Additional Details

In a recent PR I added a comment about warnings being emitted when I ran a test build locally. This got me wondering about our branch-cicd workflow and why it hadn't reported an issue which is when I found that our workflow always targets the latest release of Node.js.

This will help: https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#node-version-file

Node version file

The node-version-file input accepts a path to a file containing the version of Node.js to be used by a project, for example .nvmrc, .node-version, .tool-versions, or package.json. If both the node-version and the node-version-file inputs are provided then the node-version input is used. See supported version syntax.

The action will search for the node version file relative to the repository root.

steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
  with:
    node-version-file: '.nvmrc'
- run: npm ci
- run: npm test

Acceptance Criteria

Given our .nvmrc is populated with a valid version of Node.js
When I open a PR
Then I expect the branch integration test to use that version of Node.js when conducting the test build.

βš™οΈ Engineering Details

No response

πŸŽ‰ I&T

No response

Metadata

Metadata

Labels

Projects

Status

ToDo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions