Skip to content

Commit ceeb761

Browse files
unlikelyzeroozyxakhenry
authored
[build] Re-enable package lock (nasa#7584)
* include package lock * migrate to npm ci * remove cache busting doc and replace with npm run clean --------- Co-authored-by: Jesse Mazzella <[email protected]> Co-authored-by: Andrew Henry <[email protected]>
1 parent 10eb749 commit ceeb761

14 files changed

+12324
-58
lines changed

.circleci/config.yml

+5-37
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
version: 2.1
2+
orbs:
3+
node: circleci/[email protected]
4+
browser-tools: circleci/[email protected]
25
executors:
36
pw-focal-development:
47
docker:
@@ -11,47 +14,17 @@ executors:
1114
machine:
1215
image: ubuntu-2204:current
1316
docker_layer_caching: true
14-
parameters:
15-
BUST_CACHE:
16-
description: "Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!"
17-
default: false
18-
type: boolean
1917
commands:
2018
build_and_install:
21-
description: "All steps used to build and install. Will use cache if found"
19+
description: "All steps used to build and install."
2220
parameters:
2321
node-version:
2422
type: string
2523
steps:
2624
- checkout
27-
- restore_cache_cmd:
28-
node-version: << parameters.node-version >>
2925
- node/install:
3026
node-version: << parameters.node-version >>
31-
- run: npm install --no-audit --progress=false
32-
restore_cache_cmd:
33-
description: "Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache"
34-
parameters:
35-
node-version:
36-
type: string
37-
steps:
38-
- when:
39-
condition:
40-
equal: [false, << pipeline.parameters.BUST_CACHE >>]
41-
steps:
42-
- restore_cache:
43-
key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
44-
save_cache_cmd:
45-
description: "Custom command for saving cache."
46-
parameters:
47-
node-version:
48-
type: string
49-
steps:
50-
- save_cache:
51-
key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
52-
paths:
53-
- ~/.npm
54-
- node_modules
27+
- node/install-packages
5528
generate_and_store_version_and_filesystem_artifacts:
5629
description: "Track important packages and files"
5730
steps:
@@ -71,9 +44,6 @@ commands:
7144
steps:
7245
- run: npm run cov:e2e:report || true
7346
- run: npm run cov:e2e:<<parameters.suite>>:publish
74-
orbs:
75-
node: circleci/[email protected]
76-
browser-tools: circleci/[email protected]
7747
jobs:
7848
npm-audit:
7949
parameters:
@@ -111,8 +81,6 @@ jobs:
11181
TESTFILES=$(circleci tests glob "src/**/*Spec.js")
11282
echo "$TESTFILES" | circleci tests run --command="xargs npm run test" --verbose
11383
- run: npm run cov:unit:publish
114-
- save_cache_cmd:
115-
node-version: <<parameters.node-version>>
11684
- store_test_results:
11785
path: dist/reports/tests/
11886
- store_artifacts:

.github/PULL_REQUEST_TEMPLATE.md

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Closes <!--- Insert Issue Number(s) this PR addresses. Start by typing # will op
1717
* [ ] Has this been smoke tested?
1818
* [ ] Have you associated this PR with a `type:` label? Note: this is not necessarily the same as the original issue.
1919
* [ ] Have you associated a milestone with this PR? Note: leave blank if unsure.
20-
* [ ] Is this a breaking change to be called out in the release notes?
2120
* [ ] Testing instructions included in associated issue OR is this a dependency/testcase change?
2221

2322
### Reviewer Checklist

.github/workflows/e2e-couchdb.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
restore-keys: |
2929
${{ runner.os }}-node-
3030
31-
- run: npm install --cache ~/.npm --no-audit --progress=false
31+
- run: npm ci --no-audit --progress=false
3232

3333
- name: Login to DockerHub
3434
uses: docker/login-action@v3

.github/workflows/e2e-flakefinder.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
${{ runner.os }}-node-
3232
3333
- run: npx [email protected] install
34-
- run: npm install --cache ~/.npm --no-audit --progress=false
34+
- run: npm ci --no-audit --progress=false
3535

3636
- name: Run E2E Tests (Repeated 10 Times)
3737
run: npm run test:e2e:stable -- --retries=0 --repeat-each=10 --max-failures=50

.github/workflows/e2e-perf.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
${{ runner.os }}-node-
3030
3131
- run: npx [email protected] install
32-
- run: npm install --cache ~/.npm --no-audit --progress=false
32+
- run: npm ci --no-audit --progress=false
3333
- run: npm run test:perf:localhost
3434
- run: npm run test:perf:contract
3535
- run: npm run test:perf:memory

.github/workflows/e2e-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
3636
- run: npx [email protected] install
3737
- run: npx playwright install chrome-beta
38-
- run: npm install --cache ~/.npm --no-audit --progress=false
38+
- run: npm ci --no-audit --progress=false
3939
- run: npm run test:e2e:full -- --max-failures=40
4040
- run: npm run cov:e2e:report || true
4141
- shell: bash

.github/workflows/npm-prerelease.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/setup-node@v4
1616
with:
1717
node-version: lts/hydrogen
18-
- run: npm install
18+
- run: npm ci
1919
- run: |
2020
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
2121
npm whoami
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
node-version: lts/hydrogen
3333
registry-url: https://registry.npmjs.org/
34-
- run: npm install
34+
- run: npm ci
3535
- run: npm publish --access=public --tag unstable
3636
env:
3737
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/pr-platform.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
restore-keys: |
4646
${{ runner.os }}-${{ matrix.node_version }}-
4747
48-
- run: npm install --cache ~/.npm --no-audit --progress=false
48+
- run: npm ci --no-audit --progress=false
4949

5050
- run: npm test
5151

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,3 @@ index.html.bak
4747
.nyc_output
4848
coverage
4949
codecov
50-
51-
# :(
52-
package-lock.json

.npmrc

-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@ loglevel=warn
22

33
#Prevent folks from ignoring an important error when building from source
44
engine-strict=true
5-
6-
# Dont include lockfile
7-
package-lock=false

TESTING.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ There are a few reasons that your GitHub PR could be failing beyond simple faile
9191
### Local=Pass and CI=Fail
9292
Although rare, it is possible that your test can pass locally but fail in CI.
9393

94-
#### Busting Cache
95-
In certain circumstances, the CircleCI cache can become stale. In order to bust the cache, we've implemented a runtime boolean parameter in Circle CI creatively name BUST_CACHE. To execute:
96-
1. Navigate to the branch in Circle CI believed to have stale cache.
97-
1. Click on the 'Trigger Pipeline' button.
98-
1. Add Parameter -> Parameter Type = boolean , Name = BUST_CACHE ,Value = true
99-
1. Click 'Trigger Pipeline'
94+
### Reset your workspace
95+
It's possible that you're running with dependencies or a local environment which is out of sync with the branch you're working on. Make sure to execute the following:
96+
97+
```sh
98+
nvm use
99+
npm run clean
100+
npm install
101+
```
100102

101103
#### Run tests in the same container as CI
102104

0 commit comments

Comments
 (0)