Created
March 20, 2019 15:41
-
-
Save hok/95c512b6f1d5834aa5f313e4e9f8285d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
parallelism: 1 | |
docker: | |
- image: circleci/elixir:1.8.1-node-browsers | |
environment: | |
MIX_ENV: test | |
POSTGRES_USER: postgres | |
POSTGRES_DB: app_test | |
POSTGRES_PASSWORD: app_pw | |
- image: circleci/postgres:10-alpine | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_DB: app_test | |
POSTGRES_PASSWORD: app_pw | |
working_directory: ~/app | |
steps: | |
- checkout | |
- run: mix local.hex --force | |
- run: mix local.rebar --force | |
- restore_cache: | |
keys: | |
- v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }} | |
- v1-mix-cache-{{ .Branch }} | |
- v1-mix-cache | |
- restore_cache: | |
keys: | |
- v1-build-cache-{{ .Branch }} | |
- v1-build-cache | |
- run: mix do deps.get, compile | |
- save_cache: | |
key: v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }} | |
paths: "deps" | |
- save_cache: | |
key: v1-mix-cache-{{ .Branch }} | |
paths: "deps" | |
- save_cache: | |
key: v1-mix-cache | |
paths: "deps" | |
- save_cache: | |
key: v1-build-cache-{{ .Branch }} | |
paths: "_build" | |
- save_cache: | |
key: v1-build-cache | |
paths: "_build" | |
- restore_cache: | |
keys: | |
- v1-yarn-cache-{{ .Branch }}-{{ checksum "apps/web/assets/yarn.lock" }} | |
- v1-yarn-cache-{{ .Branch }} | |
- v1-yarn-cache | |
- run: | |
name: Install node dependencies and test (tbd) | |
working_directory: apps/web/assets | |
command: yarn install | |
- save_cache: | |
key: v1-yarn-cache-{{ .Branch }}-{{ checksum "apps/web/assets/yarn.lock" }} | |
paths: apps/web/assets/node_modules | |
- save_cache: | |
key: v1-yarn-cache-{{ .Branch }} | |
paths: apps/web/assets/node_modules | |
- save_cache: | |
key: v1-yarn-cache | |
paths: apps/web/assets/node_modules | |
- run: | |
name: Wait for DB | |
command: dockerize -wait tcp://localhost:5432 -timeout 1m | |
- run: mix test | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment