-
Notifications
You must be signed in to change notification settings - Fork 275
98 lines (84 loc) · 2.26 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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-20.04
services:
pg:
image: postgres:${{ matrix.pg.version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 5432:5432
volumes:
- /var/run/postgresql:/var/run/postgresql
strategy:
fail-fast: false
matrix:
pg:
- version: 9.4
skip_wal: skip_wal
- version: 9.5
skip_wal: skip_wal
- version: 9.6
skip_wal: skip_wal
- version: 10
- version: 11
- version: 12
- version: 13
- version: 14
pair:
- elixir: 1.11.4
otp: 23.3.3
include:
- pg:
version: 14
pair:
elixir: 1.17.1
otp: 25.3
lint: lint
env:
MIX_ENV: test
steps:
- name: "Set PG settings"
run: |
docker exec ${{ job.services.pg.id }} sh -c 'echo "wal_level=logical" >> /var/lib/postgresql/data/postgresql.conf'
docker restart ${{ job.services.pg.id }}
if: ${{ matrix.pg.skip_wal }} != 'skip_wal'
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
- uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- run: mix deps.get
- run: mix format --check-formatted
if: ${{ matrix.lint }}
- run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- run: mix deps.compile
- run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- run: mix test
env:
PGUSER: postgres
PGPASSWORD: postgres
PG_SOCKET_DIR: /var/run/postgresql