@usecomma/modulus-check
Version:
Validate a UK bank account number against a sort code using the VocaLink modulus check
101 lines (99 loc) • 2.66 kB
YAML
commands:
install_packages:
steps:
- checkout
- restore_cache:
key: v1-node-18.14.1-{{ checksum "yarn.lock" }}
- run: yarn install
- save_cache:
key: v1-node-18.14.1-{{ checksum "yarn.lock" }}
paths:
- node_modules
executors:
circle-small:
docker:
- image: cimg/base:2022.07
resource_class: small
node-small:
docker:
- image: cimg/node:18.14.1
resource_class: small
jobs:
install:
executor: node-small
steps:
- install_packages
lint:
executor: node-small
steps:
- install_packages
- run:
command: yarn lint
name: Lint
release:
executor: node-small
steps:
- checkout
- run:
command: |
npm set //registry.npmjs.org/:_authToken=$NPM_ACCESS_TOKEN
npm publish
name: Publish to NPM
tests:
executor: node-small
steps:
- install_packages
- run:
command: yarn test
name: Test
verify_circleci_config:
executor: circle-small
steps:
- checkout
- swissknife/build_and_check_circle_config:
custom-config: .circleci/config.yml
custom-error-message: Please run \"yarn build:ci\" and commit it.
fail-if-dirty: true
orbs:
node: circleci/node@5.0.1
swissknife: roopakv/swissknife@0.69.0
parameters:
release:
default: false
type: boolean
version: 2.1
workflows:
code_validation:
jobs:
- verify_circleci_config
- install:
requires:
- verify_circleci_config
- lint:
requires:
- install
- tests:
requires:
- install
when:
and:
- not: << pipeline.parameters.release >>
release:
jobs:
- verify_circleci_config
- install:
requires:
- verify_circleci_config
- lint:
requires:
- install
- tests:
requires:
- install
- release:
requires:
- lint
- tests
when:
and:
- << pipeline.parameters.release >>