2
0
mirror of https://github.com/offen/website.git synced 2024-11-22 17:10:29 +01:00
website/.circleci/config.yml

66 lines
1.6 KiB
YAML

version: 2
jobs:
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
vault:
docker:
- image: circleci/node:10
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
workflows:
version: 2
build_and_test:
jobs:
- server
- vault