-
Notifications
You must be signed in to change notification settings - Fork 130
78 lines (65 loc) · 1.95 KB
/
test_and_lint.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
name: Test & Lint
on:
push:
branches:
- master
pull_request:
jobs:
# Only run lint and formatting jobs on latest OTP/Elixir versions.
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: 27
elixir-version: 1.17
- uses: actions/cache@v4
env:
base-key: 27-1.17
with:
path: |
_build
deps
# Generate a hash of the OTP version and Elixir version
key: ${{ env.base-key }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ env.base-key }}-mix
- run: mix deps.get
name: Fetch Dependencies
- run: mix credo --strict
name: Lint (credo)
- run: mix format --check-formatted
name: Lint (mix format)
- run: mix dialyzer
name: Run dialyzer
test:
name: Run Unit tests
runs-on: ubuntu-20.04
strategy:
matrix:
elixir-version: ['1.14', '1.15', '1.16', '1.17']
otp-version: ['25', '26', '27']
exclude:
- elixir-version: '1.14'
otp-version: '27'
- elixir-version: '1.15'
otp-version: '27'
- elixir-version: '1.16'
otp-version: '27'
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp-version }}
elixir-version: ${{ matrix.elixir-version }}
- uses: actions/cache@v4
with:
path: _build
# Generate a hash of the OTP version and Elixir version
key: ${{ matrix.otp-version }}-${{ matrix.elixir-version }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: ${{ matrix.otp-version }}-${{ matrix.elixir-version }}-mix
- run: mix deps.get
name: Fetch Dependencies
- run: mix test --no-start
name: Run Tests