-
Notifications
You must be signed in to change notification settings - Fork 14
87 lines (71 loc) · 2.23 KB
/
ci.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
name: CI
on: push
env:
MIX_ENV: test
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
name: CI on OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
matrix:
otp: ['27']
elixir: ['1.17']
steps:
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Checkout the code
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-deps-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-deps-
- name: Cache compiled build
uses: actions/cache@v4
with:
path: _build
key: ${{ runner.os }}-mix-build-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-build-
${{ runner.os }}-mix-
- name: Cache dialyzer artifacts
uses: actions/cache@v4
with:
path: _dialyzer
key: ${{ runner.os }}-dialyzer-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-dialyzer-
- name: Install dependencies
run: mix deps.get
- name: Compile without warnings
id: compile
run: mix compile --warnings-as-errors
- name: Check formatting
if: ${{ !cancelled() && steps.compile.outcome == 'success' }}
run: mix format --check-formatted
- name: Check with credo
if: ${{ !cancelled() && steps.compile.outcome == 'success' }}
run: mix credo
- name: Check with dialyzer
if: ${{ !cancelled() && steps.compile.outcome == 'success' }}
run: mix dialyzer
- name: Check docs
if: ${{ !cancelled() && steps.compile.outcome == 'success' }}
run: mix docs 2>&1 | (! grep -q "warning:")
- name: Run tests and check test coverage
if: ${{ !cancelled() && steps.compile.outcome == 'success' }}
id: test
run: mix coveralls.json
- name: Upload test coverage results to Codecov
if: ${{ !cancelled() && steps.test.outcome == 'success' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true,
token: ${{ secrets.CODECOV_TOKEN }}