-
Notifications
You must be signed in to change notification settings - Fork 24
49 lines (45 loc) · 1.43 KB
/
ci.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
name: CI
on: [push]
env:
MIX_ENV: test
jobs:
lint:
runs-on: ubuntu-20.04 # Remember to update this when changing Erlang version. See https://github.com/erlef/setup-beam
steps:
- uses: actions/checkout@v1
- uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict
- name: Check format
run: mix format --check-formatted
test:
runs-on: ubuntu-20.04 # Remember to update this when changing Erlang version. See https://github.com/erlef/setup-beam
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
services:
db:
image: postgres:9.6
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict
- name: Install dependencies
run: mix deps.get
- name: Prepare DB
run: mix ecto.create && mix ecto.migrate
- name: Run tests
run: mix coveralls.github --umbrella