-
Notifications
You must be signed in to change notification settings - Fork 99
84 lines (70 loc) · 1.98 KB
/
test.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
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
pull_request:
branches:
- master
jobs:
test:
name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_DB: dataloader_test
POSTGRES_PASSWORD: postgres
strategy:
matrix:
elixir:
- '1.13'
- '1.14'
otp:
- '24'
- '25'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps cache
uses: actions/cache@v2
with:
path: |
deps
_build
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Create dializer plts path
run: mkdir -p priv/plts
- name: Restore plts cache
uses: actions/cache@v2
with:
path: priv/plts
key: plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Install package dependencies
run: mix deps.get
- name: Check code format
run: mix format --check-formatted
- name: Compile dependencies
run: mix compile
env:
MIX_ENV: test
- name: Run unit tests
run: |
mix ecto.setup
mix test
env:
MIX_ENV: test
- name: Run dialyzer
run: mix dialyzer