forked from elixir-ecto/ecto_sql
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (77 loc) · 2.65 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
name: CI
on: [push, pull_request]
jobs:
test-elixir:
runs-on: ubuntu-18.04
container: elixir:${{ matrix.elixir_version }}-slim
strategy:
matrix:
elixir_version: [1.6, 1.9]
steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
apt-get update
apt-get install -y git
mix local.rebar --force
mix local.hex --force
mix deps.get
- run: mix test
test-mysql:
runs-on: ubuntu-18.04
services:
mysql:
image: mysql:${{ matrix.mysql_version }}
env:
MYSQL_ROOT_PASSWORD: root
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
container: elixir:1.9-slim
strategy:
matrix:
mysql_version: ["5.7", "8.0"]
steps:
- name: Install MySQL Client
run: |
apt-get update
apt-get install -y wget ca-certificates gnupg
apt-key adv --recv-keys --keyserver keys.gnupg.net 8C718D3B5072E1F5
echo "deb http://repo.mysql.com/apt/debian/ stretch mysql-${{ matrix.mysql_version }}" >> /etc/apt/sources.list.d/mysql.list
apt-get update
apt-get install --allow-unauthenticated -y mysql-client
mysql --version
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
apt-get install -y git
mix local.rebar --force
mix local.hex --force
mix deps.get
- run: MYSQL_URL=root:root@mysql ECTO_ADAPTER=myxql mix test
test-pg:
runs-on: ubuntu-18.04
services:
pg:
image: postgres:${{ matrix.pg_version }}
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
container: elixir:1.9-slim
strategy:
matrix:
pg_version: ["9.4", "9.6", "11"]
steps:
- name: Install PG Client
run: |
apt-get update
apt-get install -y wget ca-certificates gnupg
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main ${{ matrix.pg_version }}" >> /etc/apt/sources.list.d/pgdg.list
apt-get update
apt-get install -y postgresql-${{ matrix.pg_version }} postgresql-contrib-${{ matrix.pg_version }}
psql --version
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
apt-get install -y git
mix local.rebar --force
mix local.hex --force
mix deps.get
- run: PG_URL=postgres:postgres@pg ECTO_ADAPTER=pg mix test