-
Notifications
You must be signed in to change notification settings - Fork 27
62 lines (59 loc) · 1.73 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
name: Continuous Integration
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- "master"
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/[email protected]
with:
elixir-version: '1.13.3' # Define the elixir version [required]
otp-version: '24.2.1' # Define the OTP version [required]
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run tests
run: mix test
- name: Check formatting
run: mix format --check-formatted
- name: Credo
run: mix credo
dialyzer:
name: Run Dialyzer for type checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set mix file hash
id: set_vars
run: |
mix_hash="${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}"
echo "::set-output name=mix_hash::$mix_hash"
- name: Cache PLT files
id: cache-plt
uses: actions/cache@v2
with:
path: |
_build/dev/*.plt
_build/dev/*.plt.hash
key: plt-cache-${{ steps.set_vars.outputs.mix_hash }}
restore-keys: |
plt-cache-
- name: Run Dialyzer
uses: erlef/[email protected]
with:
elixir-version: '1.13.3' # Define the elixir version [required]
otp-version: '24.2.1' # Define the OTP version [required]
- run: mix deps.get
- run: mix dialyzer