Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI config #91

Open
wants to merge 3 commits into
base: lion_484_templates_support_ci_test_pre
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 39 additions & 74 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
defaults: &defaults
working_directory: ~/app
docker:
- image: circleci/node:12

commands:
runtests:
description: "Checkout, install dependencies, and run tests"
steps:
- checkout
- run:
name: Install dependencies
command: npm i
- run:
name: Run tests
command: npm t
- image: cimg/node:18.17
auth:
username: $DOCKER_USER
password: $DOCKER_PASS

version: 2.1
jobs:
Expand All @@ -23,65 +14,41 @@ jobs:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install dependencies
command: npm i
- run: npm i
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
testnode12:
<<: *defaults
docker:
- image: circleci/node:12
steps:
- runtests
testnode14:
<<: *defaults
docker:
- image: circleci/node:14
steps:
- runtests
testnode16:
<<: *defaults
docker:
- image: circleci/node:16
steps:
- runtests
testnode18:
<<: *defaults
docker:
- image: cimg/node:18.17.1
steps:
- runtests
testnode20:
<<: *defaults
docker:
- image: cimg/node:20.5.1
steps:
- runtests
- persist_to_workspace:
root: .
paths:
- ./node_modules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you persist node_modules to workspace I suppose you don't need to save it to cache anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache persists between runs and makes it quicker to run the next commit

test:
<<: *defaults
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Run tests
command: npm t
lint:
- attach_workspace:
at: .
- run: npm t
- run: npm run lint -- --plugin log
omrilotan marked this conversation as resolved.
Show resolved Hide resolved
compatibility:
parameters:
image:
description: "node version"
default: "lts"
type: string
<<: *defaults
docker:
- image: "cimg/node:<<parameters.image>>"
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Check syntax
command: npm run lint -- --plugin log
- run: npm i
- run: npm t
publish:
<<: *defaults
docker:
- image: circleci/node:12
steps:
- checkout
- restore_cache:
Expand All @@ -108,28 +75,26 @@ workflows:
version: 2.1
ci-cd:
jobs:
- install
- install:
context: org-global
- compatibility:
context: org-global
matrix:
parameters:
image:
- "14.21"
- "16.20"
# - "18.17" // default image
omrilotan marked this conversation as resolved.
Show resolved Hide resolved
- "20.5"
- test:
context: org-global
requires:
- install
- lint:
requires:
- install
- testnode12
- testnode14
- testnode16
- testnode18
- testnode20
- publish:
context: org-global
requires:
- test
- lint
- testnode12
- testnode14
- testnode16
- testnode18
- testnode20
- compatibility
- glossary:
context: org-global
requires:
Expand Down