version: 2.1 orbs: node: circleci/node@4 slack: circleci/slack@3 jobs: lint: resource_class: small executor: name: node/default steps: - checkout - node/install-packages - run: name: Lint (Prettier) command: npm run lint:prettier - run: name: Lint (ESLint) command: npm run lint:eslint -- --format junit --output-file reports/eslint/results.xml - store_test_results: path: reports test: resource_class: small parameters: node-version: type: string docker: - image: cimg/node:<< parameters.node-version >> - image: circleci/postgres:alpine-ram environment: # need to keep this synced with .db.env because circleci is fucking retarded POSTGRES_DB: objection-authorize POSTGRES_USER: knex POSTGRES_HOST_AUTH_METHOD: trust steps: - checkout - node/install-packages - run: name: Test with node.js-<< parameters.node-version >> command: npm test -- --ci --runInBand --reporters=default --reporters=jest-junit environment: JEST_JUNIT_OUTPUT_NAME: results.xml JEST_JUNIT_OUTPUT_DIR: reports/jest-node<< parameters.node-version >> - store_test_results: path: reports - slack/notify-on-failure workflows: build-and-test: jobs: - lint - test: context: shared-vars requires: - lint matrix: parameters: node-version: - lts - current