-
Notifications
You must be signed in to change notification settings - Fork 97
153 lines (129 loc) · 3.99 KB
/
elixir.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
unit_test:
name: Unit Tests - Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-20.04
continue-on-error: true
strategy:
matrix:
include:
- elixir: '1.15'
otp: '26'
- elixir: '1.15'
otp: '25'
- elixir: '1.14'
otp: '26'
- elixir: '1.13'
otp: '25'
- elixir: '1.12'
otp: '24'
- elixir: '1.11'
otp: '23'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps cache
uses: actions/cache@v2
with:
path: deps
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Restore _build cache
uses: actions/cache@v2
with:
path: _build
key: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Install deps
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Compile application
run: mix compile
env:
MIX_ENV: test
- name: Run unit tests
run: |
set +e
mix test
set -e
mix test --trace --failed
integration_test:
name: Integration Tests - Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- elixir: '1.15'
otp: '26'
- elixir: '1.14'
otp: '26'
- elixir: '1.13'
otp: '25'
- elixir: '1.12'
otp: '24'
defaults:
run:
working-directory: examples
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps cache
uses: actions/cache@v3
with:
path: examples/deps
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Restore _build cache
uses: actions/cache@v3
with:
path: examples/_build
key: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Install deps
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Compile application
run: |
mix compile
env:
MIX_ENV: test
- name: Start integration test dependencies
run: |
docker compose up -d
until pg_isready -h localhost; do sleep 1; done;
until mysqladmin --protocol tcp ping; do sleep 1; done;
- name: Run integration tests
run: |
mix test
mix instrumented_task
mix uninstrumented_task
env:
MIX_ENV: test