-
Notifications
You must be signed in to change notification settings - Fork 18
82 lines (69 loc) · 2.62 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
name: Elixir CI
on:
pull_request:
branches: [main]
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test:
runs-on: ubuntu-latest
name: Test
strategy:
matrix:
otp: ["26.1.1"]
elixir: ["1.16.3"]
steps:
- uses: actions/checkout@v2
- name: Setup elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v3
id: mix-deps-cache
with:
path: deps
key: v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-${{ github.event.pull_request.base.sha }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-${{ github.event.pull_request.base.sha }}-
v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps
- name: Retrieve Mix Build Cache
uses: actions/cache@v3
id: mix-build-cache
with:
path: _build/test/lib
key: v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-build-${{ github.event.pull_request.base.sha }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-build-${{ github.event.pull_request.base.sha }}-
v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-build-
- name: Install Mix Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Check Formatting
run: |
mix format --check-formatted
- name: Clean
run: mix clean
- name: Compile
run: mix compile --warnings-as-errors
# - name: Run Credo
# run: mix credo --strict
- name: Run Tests
id: tests
# run: mix coveralls.github
run: mix test
- name: Retrieve PLT Cache
uses: actions/cache@v3
id: plt-cache
with:
path: plts
key: v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ github.event.pull_request.base.sha }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ github.event.pull_request.base.sha }}-
v1-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-
- name: Run dialyzer
run: mix dialyzer