-
Notifications
You must be signed in to change notification settings - Fork 128
83 lines (76 loc) · 2.01 KB
/
test.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
name: Torch Scrivener.Ecto Tests
on:
pull_request:
branches: [master, main]
types: [opened, edited, reopened, synchronize]
push:
branches: [master, main]
tags:
- v[2-9].[0-9]+.[0-9]+
jobs:
test:
name: mix test (Elixir ${{matrix.elixir}} | OTP ${{matrix.otp}})
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- elixir: 1.14.x
otp: 23.x
- elixir: 1.14.x
otp: 24.x
- elixir: 1.14.x
otp: 25.x
- elixir: 1.15.x
otp: 24.x
- elixir: 1.15.x
otp: 25.x
- elixir: 1.15.x
otp: 26.x
- elixir: 1.16.x
otp: 24.x
- elixir: 1.16.x
otp: 25.x
- elixir: 1.16.x
otp: 26.x
services:
db:
image: postgres:latest
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MIX_ENV: test
ImageOS: ubuntu20 # run on ubuntu-20.04 (which supports Erlang/OTP 20-25)
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Cache mix deps
uses: actions/cache@v4
with:
path: |
deps
_build
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
- name: Install hex deps
run: |
mix local.hex --force
mix local.rebar --force
- name: Install hex dependencies
run: mix deps.get --only test
- name: DB Reset
run: mix db.reset
- name: Mix Test
run: mix test
env:
MIX_ENV: test