-
Notifications
You must be signed in to change notification settings - Fork 20
100 lines (87 loc) · 2.33 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
name: CI
on:
push:
branches:
- main
paths-ignore:
- 'guides/**'
pull_request:
paths-ignore:
- 'guides/**'
env:
MIX_ENV: test
jobs:
code_quality_and_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- elixir: 1.15.0
erlang: 24.0.0
- elixir: 1.16.0
erlang: 24.0.0
- elixir: 1.17.0
erlang: 27.0.0
services:
db:
image: postgres:15
ports: ["5432:5432"]
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mariadb:
image: mariadb:11
ports: ["3306:3306"]
env:
MARIADB_ROOT_PASSWORD: root
options: >-
--health-cmd "healthcheck.sh --connect --innodb_initialized"
--health-interval 10s
--health-timeout 5s
--health-retries 5
name: Elixir v${{ matrix.elixir }}, Erlang v${{ matrix.erlang }}
steps:
- uses: actions/checkout@v4
- name: Generate test configuration
run: cp config/test.example.exs config/test.exs
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang }}
elixir-version: ${{ matrix.elixir }}
- name: Retrieve Dependencies Cache
uses: actions/cache@v4
id: mix-cache
with:
path: |
deps
_build
key: ${{ runner.os }}-${{ matrix.erlang }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }}
- name: Install Mix Dependencies
run: mix deps.get
- name: Check unused dependencies
run: mix deps.unlock --check-unused
- name: Compile dependencies
run: mix deps.compile
- name: Check format
run: mix format --check-formatted
- name: Check application compile warnings
run: mix compile --force --warnings-as-errors
- name: Check Credo warnings
run: mix credo
- name: Run Tests - SQLite3
run: mix test
env:
DB: sqlite
- name: Run Tests - PostgreSQL
run: mix test
env:
DB: postgres
- name: Run Tests - MySQL/MariaDB
run: mix test
env:
DB: mysql