version: 2.1 jobs: lint: docker: - image: cimg/node:20.16.0 working_directory: ~/repo steps: - checkout - restore_cache: key: node_modules-{{ checksum "package-lock.json" }} - run: test -d node_modules || npm i - save_cache: key: node_modules-{{ checksum "package-lock.json" }} paths: - node_modules # run tests! - run: command: npm run tslint && npm run lint unit: docker: - image: cimg/node:20.16.0 working_directory: ~/repo steps: - checkout - restore_cache: key: node_modules-{{ checksum "package-lock.json" }} - run: test -d node_modules || npm i - save_cache: key: node_modules-{{ checksum "package-lock.json" }} paths: - node_modules # run tests! - run: command: npm run unit integration: docker: - image: cimg/node:20.16.0 environment: RETRY: "1" working_directory: ~/repo resource_class: large steps: - checkout - restore_cache: key: node_modules-{{ checksum "package-lock.json" }} - run: test -d node_modules || npm i - save_cache: key: node_modules-{{ checksum "package-lock.json" }} paths: - node_modules # run tests! - run: command: npm run jest || npm run jest || npm run jest || npm run jest # Orchestrate our job run sequence workflows: build_and_test: jobs: - lint - unit - integration