version: 2 jobs: kms: docker: - image: circleci/golang:1.12 working_directory: ~/offen/kms steps: - checkout: path: ~/offen - restore_cache: key: offen-kms-{{ checksum "go.mod" }} - run: name: Download modules command: go mod download - save_cache: paths: - /go/pkg/mod key: offen-kms-{{ checksum "go.mod" }} - run: name: Generate one-off key file command: make bootstrap - run: name: Run tests command: make test-ci server: docker: - image: circleci/golang:1.12 environment: - POSTGRES_CONNECTION_STRING=postgres://circle:test@localhost:5432/circle_test?sslmode=disable - image: circleci/postgres:11.2-alpine environment: - POSTGRES_USER=circle - POSTGRES_PASSWORD=test working_directory: ~/offen/server steps: - checkout: path: ~/offen - restore_cache: key: offen-server-{{ checksum "go.mod" }} - run: name: Download modules command: go mod download - save_cache: paths: - /go/pkg/mod key: offen-server-{{ checksum "go.mod" }} - run: name: Waiting for Postgres to be ready command: | for i in `seq 1 10`; do nc -z localhost 5432 && echo Success && exit 0 echo -n . sleep 1 done echo Failed waiting for Postgres && exit 1 - run: name: Run tests command: make test-ci shared: docker: - image: circleci/golang:1.12 working_directory: ~/offen/shared steps: - checkout: path: ~/offen - run: name: Run tests command: make test vault: docker: - image: circleci/node:10-browsers working_directory: ~/offen/vault steps: - checkout: path: ~/offen - restore_cache: key: offen-vault-{{ checksum "package.json" }} - run: name: Install dependencies command: npm install - save_cache: paths: - ~/offen/vault/node_modules key: offen-vault-{{ checksum "package.json" }} - run: name: Run tests command: npm test script: docker: - image: circleci/node:10-browsers working_directory: ~/offen/script steps: - checkout: path: ~/offen - restore_cache: key: offen-script-{{ checksum "package.json" }} - run: name: Install dependencies command: npm install - save_cache: paths: - ~/offen/script/node_modules key: offen-script-{{ checksum "package.json" }} - run: name: Run tests command: npm test auditorium: docker: - image: circleci/node:10-browsers working_directory: ~/offen/auditorium steps: - checkout: path: ~/offen - restore_cache: key: offen-auditorium-{{ checksum "package.json" }} - run: name: Install dependencies command: npm install - save_cache: paths: - ~/offen/auditorium/node_modules key: offen-auditorium-{{ checksum "package.json" }} - run: name: Run tests command: npm test packages: docker: - image: circleci/node:10-browsers working_directory: ~/offen/packages steps: - checkout: path: ~/offen - restore_cache: key: offen-packages-{{ checksum "package.json" }} - run: name: Install dependencies command: npm install - save_cache: paths: - ~/offen/packages/node_modules key: offen-packages-{{ checksum "package.json" }} - run: name: Run tests command: npm test workflows: version: 2 build_and_test: jobs: - server - kms - vault - script - auditorium - packages - shared