-
Notifications
You must be signed in to change notification settings - Fork 44
70 lines (68 loc) · 1.91 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
---
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
format:
name: Format
runs-on: ubuntu-latest
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1
with:
otp-version: 22.2
elixir-version: '1.11'
- name: Install dependencies
run: mix deps.get
- name: Check format
run: mix format --check-formatted
test:
name: OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
otp: [22.2]
elixir: [1.7, 1.8, 1.9, '1.10', '1.11']
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Set up dependency cache
uses: actions/cache@v1
with:
path: deps/
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-deps-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-deps-
- name: Set up build cache
uses: actions/cache@v1
with:
path: _build/test/
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-
- name: Install dependencies
run: |
mix deps.get
- name: Compile
run: |
mix deps.compile
mix compile --force --warnings-as-errors
- name: Run tests
if: matrix.elixir != '1.11'
run: mix test
- name: Run tests (with coverage)
if: matrix.elixir == '1.11'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mix coveralls.github