1
+ name : CI
2
+
1
3
on : push
2
4
3
- jobs :
4
- lint :
5
- runs-on : ubuntu-latest
6
- name : lint OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
7
- strategy :
8
- matrix :
9
- otp : ['26']
10
- elixir : ['1.16']
11
- steps :
12
- - uses : actions/checkout@v2
13
- - uses : erlef/setup-beam@v1
14
- with :
15
- otp-version : ${{matrix.otp}}
16
- elixir-version : ${{matrix.elixir}}
17
- - run : mix deps.get
18
- - run : mix credo
19
- - run : mix dialyzer
20
- - run : mix format --check-formatted
21
- - run : mix docs 2>&1 | (! grep -q "warning:")
5
+ env :
6
+ MIX_ENV : test
7
+
8
+ permissions :
9
+ contents : read
22
10
11
+ jobs :
23
12
test :
24
13
runs-on : ubuntu-latest
25
- name : test OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
14
+ name : CI on OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
26
15
strategy :
27
16
matrix :
28
17
otp : ['26']
29
18
elixir : ['1.16']
30
- env :
31
- MIX_ENV : test
32
19
steps :
33
- - uses : actions/checkout@v2
34
- - uses : erlef/setup-beam@v1
35
- with :
36
- otp-version : ${{matrix.otp}}
37
- elixir-version : ${{matrix.elixir}}
38
- - run : mix deps.get
39
- - run : mix coveralls.json
40
- - uses : codecov/codecov-action@v3
20
+ - name : Set up Elixir
21
+ uses : erlef/setup-beam@v1
22
+ with :
23
+ otp-version : ${{matrix.otp}}
24
+ elixir-version : ${{matrix.elixir}}
25
+
26
+ - name : Checkout the code
27
+ uses : actions/checkout@v4
28
+
29
+ - name : Cache dependencies
30
+ uses : actions/cache@v4
31
+ with :
32
+ path : deps
33
+ key : ${{ runner.os }}-mix-deps-${{ hashFiles('**/mix.lock') }}
34
+ restore-keys : |
35
+ ${{ runner.os }}-mix-deps-
36
+
37
+ - name : Cache compiled build
38
+ uses : actions/cache@v4
39
+ with :
40
+ path : _build
41
+ key : ${{ runner.os }}-mix-build-${{ hashFiles('**/mix.lock') }}
42
+ restore-keys : |
43
+ ${{ runner.os }}-mix-build-
44
+ ${{ runner.os }}-mix-
45
+
46
+ - name : Cache dialyzer artifacts
47
+ uses : actions/cache@v4
48
+ with :
49
+ path : _dialyzer
50
+ key : ${{ runner.os }}-dialyzer-${{ hashFiles('**/mix.lock') }}
51
+ restore-keys : |
52
+ ${{ runner.os }}-dialyzer-
53
+
54
+ - name : Install dependencies
55
+ run : mix deps.get
56
+
57
+ - name : Compile without warnings
58
+ id : compile
59
+ run : mix compile --warnings-as-errors
60
+
61
+ - name : Check formatting
62
+ if : ${{ !cancelled() && steps.compile.outcome == 'success' }}
63
+ run : mix format --check-formatted
64
+
65
+ - name : Check with credo
66
+ if : ${{ !cancelled() && steps.compile.outcome == 'success' }}
67
+ run : mix credo
68
+
69
+ - name : Check with dialyzer
70
+ if : ${{ !cancelled() && steps.compile.outcome == 'success' }}
71
+ run : mix dialyzer
72
+
73
+ - name : Check docs
74
+ if : ${{ !cancelled() && steps.compile.outcome == 'success' }}
75
+ run : mix docs 2>&1 | (! grep -q "warning:")
76
+
77
+ - name : Run tests and check test coverage
78
+ if : ${{ !cancelled() && steps.compile.outcome == 'success' }}
79
+ id : test
80
+ run : mix coveralls.json
81
+
82
+ - name : Upload test coverage results to Codecov
83
+ if : ${{ !cancelled() && steps.test.outcome == 'success' }}
84
+ uses : codecov/codecov-action@v4
85
+ with :
86
+ fail_ci_if_error : true,
87
+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments