forked from elixir-ecto/myxql
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (78 loc) · 2.25 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
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: "test ${{ matrix.db }} ${{ matrix.pair.elixir }}/${{ matrix.pair.otp }} ${{ matrix.lint }}"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
db:
- mysql:5.7
- mysql:8.3
- mariadb:10.11
pair:
# - elixir: 1.16
# otp: 26
- elixir: 1.16.3
otp: 26.2.5
include:
- db: mysql:5.7
pair:
elixir: 1.7.4
otp: 21.3.8.24
- db: mysql:5.7
pair:
elixir: 1.16.3
otp: 26.2.5
lint: lint
- db: mysql:8.3
pair:
elixir: 1.7.4
otp: 21.3.8.24
- db: mysql:8.3
pair:
elixir: 1.16.3
otp: 26.2.5
lint: lint
- db: mariadb:10.11
pair:
elixir: 1.7.4
otp: 21.3.8.24
- db: mariadb:10.11
pair:
elixir: 1.16.3
otp: 26.2.5
env:
MIX_ENV: test
DB: ${{ matrix.db }}
MYSQL_UNIX_PORT: /var/run/mysqld/mysqld.sock
steps:
- run: sudo mkdir -p /var/run/mysqld
- run: sudo chmod 777 /var/run/mysqld
- run: docker run -p 3306:3306 --volume /var/run/mysqld:/var/run/mysqld -e MYSQL_ALLOW_EMPTY_PASSWORD=1 --detach ${{matrix.db}} --innodb_log_file_size=1G
- run: until mysql --port 3306 --protocol=tcp -u root -e "SELECT @@version;"; do sleep 3; done
- 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') }}
- 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