Skip to content

Commit

Permalink
build(ci): fail on package-lock.json sync issues #9111
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Jun 1, 2024
1 parent 682b4b8 commit 749c218
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
parameters:
lockindex:
type: string
default: '0'
default: '1'

orbs:
windows: circleci/[email protected]
Expand Down Expand Up @@ -79,15 +79,18 @@ commands:
steps:
- checkout
- restore_cache:
key: << parameters.dir >>-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/<< parameters.dir >>/package-lock.json" }}
key: << parameters.dir >>-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/<< parameters.dir >>/package.json" }}-{{ checksum "e2e/<< parameters.dir >>/package-lock.json" }}
- run:
name: NPM Install
command: |
md5sum e2e/<< parameters.dir >>/package-lock.json > package.md5
if [ ! -d "e2e/<< parameters.dir >>/node_modules/" ]; then
npm run i:ci:<< parameters.dir >>
fi
md5sum -c package.md5
rm package.md5
- save_cache:
key: << parameters.dir >>-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/<< parameters.dir >>/package-lock.json" }}
key: << parameters.dir >>-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/<< parameters.dir >>/package.json" }}-{{ checksum "e2e/<< parameters.dir >>/package-lock.json" }}
paths:
- ./e2e/<< parameters.dir >>/node_modules
- ~/.cache/puppeteer
Expand All @@ -112,7 +115,7 @@ commands:
- attach_workspace:
at: dist
- restore_cache:
key: << parameters.dir >>-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/<< parameters.dir >>/package-lock.json" }}
key: << parameters.dir >>-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/<< parameters.dir >>/package.json" }}-{{ checksum "e2e/<< parameters.dir >>/package-lock.json" }}
- run:
name: Spreading Build
command: npm run s:<< parameters.dir >>
Expand All @@ -135,7 +138,7 @@ commands:
- attach_workspace:
at: dist
- restore_cache:
key: << parameters.dir >>-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/<< parameters.dir >>/package-lock.json" }}
key: << parameters.dir >>-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/<< parameters.dir >>/package.json" }}-{{ checksum "e2e/<< parameters.dir >>/package-lock.json" }}
- run:
name: Spreading Build
command: npm run s:<< parameters.dir >>
Expand All @@ -152,15 +155,18 @@ jobs:
steps:
- checkout
- restore_cache:
key: root-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "package-lock.json" }}
key: root-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- run:
name: NPM Install
command: |
md5sum package-lock.json > package.md5
if [ ! -d "./node_modules/" ]; then
npm ci
fi
md5sum -c package.md5
rm package.md5
- save_cache:
key: root-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "package-lock.json" }}
key: root-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- ~/.cache/puppeteer
Expand Down Expand Up @@ -238,15 +244,18 @@ jobs:
steps:
- checkout
- restore_cache:
key: tests-e2e-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "tests-e2e/package-lock.json" }}
key: tests-e2e-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "tests-e2e/package.json" }}-{{ checksum "tests-e2e/package-lock.json" }}
- run:
name: NPM Install
command: |
md5sum tests-e2e/package-lock.json > package.md5
if [ ! -d "./tests-e2e/node_modules/" ]; then
npm run i:tests-e2e
fi
md5sum -c package.md5
rm package.md5
- save_cache:
key: tests-e2e-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "tests-e2e/package-lock.json" }}
key: tests-e2e-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "tests-e2e/package.json" }}-{{ checksum "tests-e2e/package-lock.json" }}
paths:
- ./tests-e2e/node_modules
- ~/.cache/puppeteer
Expand All @@ -270,15 +279,18 @@ jobs:
steps:
- checkout
- restore_cache:
key: docs-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "docs/package-lock.json" }}
key: docs-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "docs/package.json" }}-{{ checksum "docs/package-lock.json" }}
- run:
name: NPM Install
command: |
md5sum docs/package-lock.json > package.md5
if [ ! -d "./docs/node_modules/" ]; then
npm run i:docs
fi
md5sum -c package.md5
rm package.md5
- save_cache:
key: docs-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "docs/package-lock.json" }}
key: docs-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "docs/package.json" }}-{{ checksum "docs/package-lock.json" }}
paths:
- ./docs/node_modules
- ~/.cache/puppeteer
Expand All @@ -302,7 +314,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: root-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "package-lock.json" }}
key: root-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- run:
name: Default
command: KARMA_SUITE=tests-performance/test.spec.ts npm run test
Expand Down Expand Up @@ -350,7 +362,7 @@ jobs:
- attach_workspace:
at: dist
- restore_cache:
key: a5es5-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a5es5/package-lock.json" }}
key: a5es5-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a5es5/package.json" }}-{{ checksum "e2e/a5es5/package-lock.json" }}
- run: nvm install $(cat e2e/a5es5/.nvmrc)
- run: nvm use $(cat e2e/a5es5/.nvmrc)
- run:
Expand All @@ -359,11 +371,14 @@ jobs:
- run:
name: NPM Install
command: |
md5sum e2e/a5es5/package-lock.json > package.md5
if [ ! -d "e2e/a5es5/node_modules/" ]; then
npm run i:a5es5
fi
md5sum -c package.md5
rm package.md5
- save_cache:
key: a5es5-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a5es5/package-lock.json" }}
key: a5es5-<< pipeline.parameters.lockindex >>-{{ arch }}-{{ checksum "e2e/a5es5/package.json" }}-{{ checksum "e2e/a5es5/package-lock.json" }}
paths:
- ./e2e/a5es5/node_modules
- ~/.cache/puppeteer
Expand Down

0 comments on commit 749c218

Please sign in to comment.