Skip to content

Commit

Permalink
Update to node 16 and test node 14 in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
juanSanchezAlcala committed Apr 20, 2022
1 parent 08183db commit b1137e2
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 31 deletions.
87 changes: 63 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,54 @@

references:

container_config_node: &container_config_node
container_config_node:
&container_config_node
working_directory: ~/project/build
docker:
- image: circleci/node:12
- image: circleci/node:<< parameters.node-version >>
parameters:
node-version:
default: "16.14"
type: string

workspace_root: &workspace_root
~/project
workspace_root: &workspace_root ~/project

attach_workspace: &attach_workspace
attach_workspace:
&attach_workspace
attach_workspace:
at: *workspace_root

npm_cache_keys: &npm_cache_keys
npm_cache_keys:
&npm_cache_keys
keys:
- v2-dependency-npm-{{ checksum "package.json" }}-
- v2-dependency-npm-{{ checksum "package.json" }}
- v2-dependency-npm-
- v2-dependency-npm-{{ checksum "package.json" }}-
- v2-dependency-npm-{{ checksum "package.json" }}
- v2-dependency-npm-

cache_npm_cache: &cache_npm_cache
cache_npm_cache:
&cache_npm_cache
save_cache:
key: v2-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
key: v2-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
- ./node_modules/

restore_npm_cache: &restore_npm_cache
restore_npm_cache:
&restore_npm_cache
restore_cache:
<<: *npm_cache_keys
<<: *npm_cache_keys

filters_only_main: &filters_only_main
filters_only_main:
&filters_only_main
branches:
only: main

filters_ignore_tags: &filters_ignore_tags
filters_ignore_tags:
&filters_ignore_tags
tags:
ignore: /.*/

filters_version_tag: &filters_version_tag
filters_version_tag:
&filters_version_tag
tags:
only:
- /^v?\d+\.\d+\.\d+(?:-beta\.\d+)?$/
Expand Down Expand Up @@ -69,7 +80,9 @@ jobs:
- checkout
- run:
name: Checkout next-ci-shared-helpers
command: git clone --depth 1 [email protected]:Financial-Times/next-ci-shared-helpers.git .circleci/shared-helpers
command: git clone --depth 1
[email protected]:Financial-Times/next-ci-shared-helpers.git
.circleci/shared-helpers
- *restore_npm_cache
- node/install-npm:
version: "7"
Expand Down Expand Up @@ -114,11 +127,13 @@ jobs:
- *attach_workspace
- run:
name: Set npm auth token
command: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc
command: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >
${HOME}/.npmrc
- run:
name: shared-helper / npm-store-auth-token
command: .circleci/shared-helpers/helper-npm-store-auth-token
- run: npx snyk monitor --org=customer-products --project-name=Financial-Times/n-es-client
- run: npx snyk monitor --org=customer-products
--project-name=Financial-Times/n-es-client
- run:
name: shared-helper / npm-version-and-publish-public
command: .circleci/shared-helpers/helper-npm-version-and-publish-public
Expand All @@ -132,26 +147,42 @@ workflows:
- build:
filters:
<<: *filters_ignore_main_tags_renovate_nori
name: build-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ "16.14", "14.19" ]
- test:
requires:
- build
- build-v<< matrix.node-version >>
name: test-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ "16.14", "14.19" ]

build-test-publish:
jobs:
- build:
filters:
<<: *filters_version_tag
name: build-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ "16.14", "14.19" ]
- test:
filters:
<<: *filters_version_tag
requires:
- build
- build-v<< matrix.node-version >>
name: test-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ "16.14", "14.19" ]
- publish:
context: npm-publish-token
filters:
<<: *filters_version_tag
requires:
- test
- test-v16.14

renovate-nori-build-test-provision:
jobs:
Expand All @@ -175,7 +206,15 @@ workflows:
jobs:
- build:
context: next-nightly-build
name: build-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ "16.14", "14.19" ]
- test:
requires:
- build
- build-v<< matrix.node-version >>
context: next-nightly-build
name: test-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ "16.14", "14.19" ]
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12
16
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"signed-aws-es-fetch": "^1.4.0"
},
"devDependencies": {
"@financial-times/n-gage": "^8.3.0",
"@financial-times/n-gage": "^8.3.2",
"chai": "^4.1.0",
"check-engine": "^1.10.1",
"coveralls": "^3.0.0",
Expand All @@ -25,7 +25,7 @@
"snyk": "^1.167.2"
},
"engines": {
"node": "12.x",
"node": "14.x || 16.x",
"npm": "7.x || 8.x"
},
"scripts": {
Expand All @@ -40,7 +40,6 @@
}
},
"volta": {
"node": "12.22.11",
"npm": "7.20.2"
"node": "16.14.2"
}
}

0 comments on commit b1137e2

Please sign in to comment.