-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (59 loc) · 1.79 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
name: Build and Test
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
analysis:
name: Run Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.14.1' # define the elixir version [required]
otp-version: '25.0' # define the otp version [required]
- uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- name: Cache Dialyzer
id: cache-dialyzer
uses: actions/cache@v2
with:
path: priv/plts
key: ${{ runner.os }}-new-plts
- name: Install dependencies
run: mix deps.get
- name: Compile
run: mix compile -all-warnings --warnings-as-errors
- name: Check for unused dependencies
run: mix deps.unlock --check-unused
- name: Check compilation dependencies
run: mix xref graph --label compile-connected --fail-above 0
- name: Static Analysis
run: mix dialyzer --halt-exit-status
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.12.1' # Define the elixir version [required]
otp-version: '24.0' # Define the OTP version [required]
- uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run tests
run: MIX_ENV=test mix do compile, test