Use `npm ci` in CI

So there is no attempt to update the lock file.
This commit is contained in:
Franck Royer 2022-06-17 16:30:03 +10:00
parent 612027a375
commit 04fbc55fdf
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
3 changed files with 5 additions and 5 deletions

View File

@ -44,9 +44,9 @@ jobs:
path: ~/.npm path: ~/.npm
key: examples-node-v1-${{ hashFiles('**/package-lock.json') }} key: examples-node-v1-${{ hashFiles('**/package-lock.json') }}
- name: (npm) ${{ matrix.example }} install using npm i - name: (npm) ${{ matrix.example }} install using npm ci
if: steps.use-yarn.outputs.lockfile != 'yarn.lock' if: steps.use-yarn.outputs.lockfile != 'yarn.lock'
run: npm install run: npm ci
working-directory: examples/${{ matrix.example }} working-directory: examples/${{ matrix.example }}
- name: (npm) ${{ matrix.example }} test - name: (npm) ${{ matrix.example }} test

View File

@ -19,7 +19,7 @@ pipeline {
stages { stages {
stage('Deps') { stage('Deps') {
steps { steps {
sh 'npm install' sh 'npm ci'
} }
} }
@ -64,7 +64,7 @@ pipeline {
def buildExample(example=STAGE_NAME) { def buildExample(example=STAGE_NAME) {
def dest = "${WORKSPACE}/build/docs/examples/${example}" def dest = "${WORKSPACE}/build/docs/examples/${example}"
dir("examples/${example}") { dir("examples/${example}") {
sh 'npm install' sh 'npm ci'
sh 'npm run build' sh 'npm run build'
sh "mkdir -p ${dest}" sh "mkdir -p ${dest}"
sh "cp -r build/. ${dest}" sh "cp -r build/. ${dest}"

View File

@ -38,7 +38,7 @@
"pretest": "run-s pretest:*", "pretest": "run-s pretest:*",
"pretest:1-init-git-submodules": "[ -f './nim-waku/build/wakunode2' ] || git submodule update --init --recursive", "pretest:1-init-git-submodules": "[ -f './nim-waku/build/wakunode2' ] || git submodule update --init --recursive",
"pretest:2-build-nim-waku": "[ -f './nim-waku/build/wakunode2' ] || run-s nim-waku:build", "pretest:2-build-nim-waku": "[ -f './nim-waku/build/wakunode2' ] || run-s nim-waku:build",
"examples:pretest": "for d in examples/*/; do (cd $d && npm install); done", "examples:pretest": "for d in examples/*/; do (cd $d && npm ci); done",
"nim-waku:build": "(cd nim-waku; NIMFLAGS=\"-d:chronicles_colors=off -d:chronicles_sinks=textlines -d:chronicles_log_level=TRACE\" make -j$(nproc --all 2>/dev/null || echo 2) wakunode2)", "nim-waku:build": "(cd nim-waku; NIMFLAGS=\"-d:chronicles_colors=off -d:chronicles_sinks=textlines -d:chronicles_log_level=TRACE\" make -j$(nproc --all 2>/dev/null || echo 2) wakunode2)",
"nim-waku:force-build": "(cd nim-waku && rm -rf ./build/ ./vendor && make -j$(nproc --all 2>/dev/null || echo 2) update) && run-s nim-waku:build", "nim-waku:force-build": "(cd nim-waku && rm -rf ./build/ ./vendor && make -j$(nproc --all 2>/dev/null || echo 2) update) && run-s nim-waku:build",
"test": "run-s test:*", "test": "run-s test:*",