Skip to content

Commit

Permalink
internal/ci: run 'npm install' instead of 'npm ci'
Browse files Browse the repository at this point in the history
Use 'npm install' in CI, rather than 'npm ci', because the latter does
not appear to fail when, for example, the top-level 'version' field in
package.json is out of sync with package-lock.json. So whilst 'npm
install' is less efficient than 'npm ci' in a CI context, the two are
identical from a "which packages got installed" perspective, because we
always check that the repo is clean at the end of the workflow.

Signed-off-by: Paul Jolly <[email protected]>
Change-Id: I808a4ea574165d7f251b20fe8429a6458c5cc39b
Dispatch-Trailer: {"type":"trybot","CL":1204600,"patchset":2,"ref":"refs/changes/00/1204600/2","targetBranch":"master"}
  • Loading branch information
myitcv authored and cueckoo committed Nov 26, 2024
1 parent de355f5 commit 7c947bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/trybot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ jobs:
- run: cue login --token=${CUE_TOKEN}
env:
CUE_TOKEN: ${{ secrets.NOTCUECKOO_CUE_TOKEN }}
- name: Add node_modules/.bin to PATH and npm ci
- name: Add node_modules/.bin to PATH and npm install
run: |-
echo "PATH=$PWD/node_modules/.bin:$PATH" >> $GITHUB_ENV
npm ci
npm install
- working-directory: extension
name: Add node_modules/.bin to PATH and npm ci
name: Add node_modules/.bin to PATH and npm install
run: |-
echo "PATH=$PWD/node_modules/.bin:$PATH" >> $GITHUB_ENV
npm ci
npm install
- name: Verify
run: go mod verify
- name: Generate
Expand Down
12 changes: 10 additions & 2 deletions internal/ci/github/trybot.cue
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,19 @@ workflows: trybot: _repo.bashWorkflow & {

// Update PATH to add node_modules/.bin, for both the root level
// package.json used for tooling, and within the extension.
//
// NOTE: we use 'npm install' here, rather than 'npm ci', because the
// latter does not appear to fail when, for example, the top-level
// 'version' field in package.json is out of sync with package-lock.json.
// So whilst 'npm install' is less efficient than 'npm ci' in a CI
// context, the two are identical from a "which packages got installed"
// perspective, because we always check that the repo is clean at the end
// of the workflow.
let npmSetup = {
name: "Add node_modules/.bin to PATH and npm ci"
name: "Add node_modules/.bin to PATH and npm install"
run: """
echo "PATH=$PWD/node_modules/.bin:$PATH" >> $GITHUB_ENV
npm ci
npm install
"""
}

Expand Down

0 comments on commit 7c947bc

Please sign in to comment.