-
Notifications
You must be signed in to change notification settings - Fork 187
113 lines (98 loc) · 3.53 KB
/
main.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: CI
on: [push, pull_request]
jobs:
format:
name: Format
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 24
elixir-version: 1.12
version-type: strict
- name: Install dependencies
run: mix deps.get
- name: Check mix format
run: mix format --check-formatted
test:
name: Test
runs-on: ubuntu-18.04
services:
postgres:
image: postgres:9.6
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
pair:
- erlang: master
elixir: 1.14.0
- erlang: 25.0
elixir: main
- erlang: 25.0
elixir: 1.14.0
- erlang: 25.0
elixir: 1.13.4
- erlang: 24.0
elixir: 1.12.3
- erlang: 23.1
elixir: 1.11.3
- erlang: 23.1
elixir: 1.10.4
- erlang: 22.3
elixir: 1.9.4
- erlang: 21.3
elixir: 1.8.1
- erlang: 21.3
elixir: 1.7.2
- erlang: 21.3
elixir: 1.6.6
- erlang: 20.3
elixir: 1.5.3
env:
HEXPM_OTP: OTP-25.0
HEXPM_ELIXIR: v1.14.0
HEXPM_PATH: hexpm
HEXPM_ELIXIR_PATH: hexpm_elixir
HEXPM_OTP_PATH: hexpm_otp
HEXPM_MIX_HOME: hexpm_mix
HEXPM_MIX_ARCHIVES: hexpm_mix
steps:
- uses: actions/checkout@v3
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.erlang}}
elixir-version: ${{matrix.pair.elixir}}
version-type: strict
- name: Install OTP and Elixir for hexpm
run: |
wget https://repo.hex.pm/builds/otp/ubuntu-16.04/${HEXPM_OTP}.tar.gz
mkdir -p ${HEXPM_OTP_PATH}
tar -xf ${HEXPM_OTP}.tar.gz -C ${HEXPM_OTP_PATH} --strip-components=1
${HEXPM_OTP_PATH}/Install -minimal $(pwd)/${HEXPM_OTP_PATH}
wget https://repo.hex.pm/builds/elixir/${HEXPM_ELIXIR}.zip
unzip -d ${HEXPM_ELIXIR_PATH} ${HEXPM_ELIXIR}.zip
mkdir -p ${HEXPM_MIX_HOME}
PATH=$(pwd)/${HEXPM_ELIXIR_PATH}/bin:$(pwd)/${HEXPM_OTP_PATH}/bin:${PATH} MIX_HOME=$(pwd)/${HEXPM_MIX_HOME} MIX_ARCHIVES=$(pwd)/${HEXPM_MIX_HOME} mix local.hex --force
PATH=$(pwd)/${HEXPM_ELIXIR_PATH}/bin:$(pwd)/${HEXPM_OTP_PATH}/bin:${PATH} MIX_HOME=$(pwd)/${HEXPM_MIX_HOME} MIX_ARCHIVES=$(pwd)/${HEXPM_MIX_HOME} mix local.rebar --force
- name: Set up hexpm
run: |
git clone https://github.com/hexpm/hexpm.git hexpm
cd hexpm; PATH=$(pwd)/../${HEXPM_ELIXIR_PATH}/bin:$(pwd)/../${HEXPM_OTP_PATH}/bin:${PATH} MIX_HOME=$(pwd)/../${HEXPM_MIX_HOME} MIX_ARCHIVES=$(pwd)/../${HEXPM_MIX_HOME} MIX_ENV=hex ../${HEXPM_ELIXIR_PATH}/bin/mix deps.get; cd ..
cd hexpm; PATH=$(pwd)/../${HEXPM_ELIXIR_PATH}/bin:$(pwd)/../${HEXPM_OTP_PATH}/bin:${PATH} MIX_HOME=$(pwd)/../${HEXPM_MIX_HOME} MIX_ARCHIVES=$(pwd)/../${HEXPM_MIX_HOME} MIX_ENV=hex ../${HEXPM_ELIXIR_PATH}/bin/mix compile; cd ..
- name: Install dependencies
run: |
sudo rm -rf /usr/local/bin/rebar3
mix deps.get
mix deps.compile
- name: Run tests
run: mix test