-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (67 loc) · 1.91 KB
/
config.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
name: Github Actions CI
on:
push:
branches: [ "main" ]
pull_request:
jobs:
build:
# Containers must run in Linux based operating systems
runs-on: ubuntu-20.04
name: Build and test
env:
MIX_ENV: test
strategy:
matrix:
otp: ['26.2']
elixir: ['1.15.7']
services:
postgres:
image: postgres:13-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bitcrowd_ecto_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
version-type: 'strict'
- run: mix local.hex --force
- run: mix local.rebar --force
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: v1-mix-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
restore-keys: v1-mix-${{ runner.os }}
- name: Restore build cache
uses: actions/cache@v3
with:
path: _build
key: v1-build-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
restore-keys: v1-build-${{ runner.os }}
- name: Install dependencies
run: mix do deps.get, compile
- name: Restore plts cache
uses: actions/cache@v3
with:
path: _plts
key: v1-plt-${{ runner.os }}-${{ hashFiles('**/mix.lock') }}
restore-keys: v1-plt-${{ runner.os }}
- name: Linter
run: mix lint
- name: Init DB
run: mix do ecto.create, ecto.migrate
- name: Run tests
run: mix test