Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

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
ivomurrell committed Mar 1, 2022
1 parent c601cdb commit 3efc5db
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 30 deletions.
108 changes: 80 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,67 @@

references:

container_config_node: &container_config_node
container_config_node:
&container_config_node
working_directory: ~/project/build
docker:
- image: cimg/node:12.22
- image: cimg/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:
- v10-dependency-npm-{{ checksum "package.json" }}-
- v10-dependency-npm-{{ checksum "package.json" }}
- v10-dependency-npm-
- v10-dependency-npm-{{ checksum "package.json" }}-
- v10-dependency-npm-{{ checksum "package.json" }}
- v10-dependency-npm-

cache_npm_cache: &cache_npm_cache
cache_npm_cache:
&cache_npm_cache
save_cache:
key: v10-dependency-npm-{{ checksum "package.json" }}-{{ epoch }}
paths:
key: v10-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+)?$/
branches:
ignore: /.*/

filters_only_renovate_nori: &filters_only_renovate_nori
filters_only_renovate_nori:
&filters_only_renovate_nori
branches:
only: /(^renovate-.*|^nori/.*)/

filters_ignore_tags_renovate_nori: &filters_ignore_tags_renovate_nori
filters_ignore_tags_renovate_nori:
&filters_ignore_tags_renovate_nori
tags:
ignore: /.*/
branches:
Expand All @@ -69,7 +82,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 @@ -112,7 +127,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-heroku-tools
- run: npx snyk monitor --org=customer-products
--project-name=Financial-Times/n-heroku-tools
- run:
name: shared-helper / npm-version-and-publish-public
command: .circleci/shared-helpers/helper-npm-version-and-publish-public
Expand All @@ -126,38 +142,66 @@ workflows:
- build:
filters:
<<: *filters_ignore_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:
filters:
<<: *filters_version_tag
requires:
- test
- test-v<< matrix.node-version >>
name: publish-v<< matrix.node-version >>
matrix:
parameters:
node-version: [ "16.14", "14.19" ]

renovate-nori-build-test:
jobs:
- waiting-for-approval:
type: approval
filters:
<<: *filters_only_renovate_nori
<<: *filters_only_renovate_nori
- build:
requires:
- waiting-for-approval
- waiting-for-approval
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" ]

nightly:
triggers:
Expand All @@ -168,10 +212,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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@financial-times/n-heroku-tools",
"version": "0.0.0",
"engines": {
"node": "12.x",
"node": "14.x || 16.x",
"npm": "7.x || 8.x"
},
"bin": {
Expand Down Expand Up @@ -53,7 +53,7 @@
}
},
"volta": {
"node": "12.22.5",
"node": "16.14.0",
"npm": "7.20.2"
}
}

0 comments on commit 3efc5db

Please sign in to comment.