-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
71 lines (70 loc) · 2 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
version: 2
jobs:
build:
parallelism: 1
docker:
- image: defactosoftware/elixir
MIX_ENV: test
- image: circleci/postgres:10.1-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_DB: bear_necessities_test
POSTGRES_PASSWORD: postgres
steps:
- checkout
- restore_cache:
paths:
- /root/.mix/archives
keys:
- v1-hex-archive
- v1-mix-deps-{{ checksum "mix.lock" }}
- run:
name: Install node
command: |
set +e
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
export NVM_DIR="/root/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install
# Each step uses the same `$BASH_ENV`, so need to modify it
echo 'export NVM_DIR="/root/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- run:
name: Create local hex archive
command: mix local.hex --force
- run:
name: Create local rebar
command: mix local.rebar --force
- run:
name: Installing Elixir dependencies
command: mix deps.get
- run:
name: Compile the Phoenix app
command: mix compile
- run:
name: Phoenix digest
command: mix phx.digest
- run:
name: Creating Postgres database
command: mix ecto.create
- run:
name: Running Elixir tests
command: mix test
- save_cache:
key: v1-hex-archive
paths:
- /root/.mix/archives
- save_cache:
key: v1-mix-deps-{{ checksum "mix.lock" }}
paths:
- "deps"
- "_build"
- save_cache:
key: v1-yarn-deps-{{ checksum "yarn.lock" }}
paths:
- "node_modules"
experimental:
notify:
branches:
only:
- master