Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #26 from Financial-Times/acc-1606-upgrade-to-node-16
Browse files Browse the repository at this point in the history
Acc 1589 upgrade to node 16
  • Loading branch information
polkwc authored May 5, 2022
2 parents 920cda1 + 7bdc478 commit 232a1af
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 109 deletions.
98 changes: 71 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,69 @@

references:

container_config_node: &container_config_node
container_config_node:
&container_config_node
working_directory: ~/project/build
docker:
- image: circleci/node:12-browsers

container_config_lambda_node: &container_config_lambda_node
- image: cimg/node:<< parameters.node-version >>-browsers
parameters:
node-version:
default: "16.14"
type: string

container_config_lambda_node:
&container_config_lambda_node
working_directory: ~/project/build
docker:
- image: lambci/lambda:build-nodejs12.x
- image: lambci/lambda:build-nodejs<< parameters.node-version >>
parameters:
node-version:
default: "14.19"
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_main: &filters_ignore_main
filters_ignore_main:
&filters_ignore_main
branches:
ignore: 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 All @@ -68,7 +85,9 @@ jobs:
- checkout
- run:
name: Checkout next-ci-shared-helpers
command: git clone --depth 1 git@github.com:Financial-Times/next-ci-shared-helpers.git .circleci/shared-helpers
command: git clone --depth 1
git@github.com:Financial-Times/next-ci-shared-helpers.git
.circleci/shared-helpers
- *restore_npm_cache
- node/install-npm:
version: "7"
Expand Down Expand Up @@ -114,7 +133,8 @@ jobs:
- 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-auto-metrics
- run: npx snyk monitor --org=customer-products
--project-name=Financial-Times/n-auto-metrics
- run:
name: shared-helper / npm-version-and-publish-public
command: .circleci/shared-helpers/helper-npm-version-and-publish-public
Expand All @@ -128,26 +148,42 @@ workflows:
- build:
filters:
<<: *filters_ignore_tags
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

nightly:
triggers:
Expand All @@ -158,10 +194,18 @@ 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" ]

notify:
webhooks:
Expand Down
85 changes: 5 additions & 80 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"supertest": "^3.1.0"
},
"engines": {
"node": "12.x",
"node": "14.x || 16.x",
"npm": "7.x || 8.x"
},
"husky": {
Expand All @@ -51,7 +51,7 @@
}
},
"volta": {
"node": "12.22.8",
"node": "16.14.0",
"npm": "7.20.2"
}
}

0 comments on commit 232a1af

Please sign in to comment.