-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (56 loc) · 1.87 KB
/
check.yml
File metadata and controls
71 lines (56 loc) · 1.87 KB
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
name: Pull Request Check
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
check:
name: Check
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
strategy:
matrix:
otp: ['22.x', '23.x']
elixir: ['1.9.x', '1.10.x', '1.11.x']
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v2
- name: Install OTP and Elixir
uses: actions/setup-elixir@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
experimental-otp: true
- uses: actions/cache@v2
id: deps-cache
with:
path: deps
key: deps-${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
deps-${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-
- uses: actions/cache@v2
id: build-cache
with:
path: _build/test
key: build-test-${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
build-test-${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-
- name: Download deps
if: steps.deps-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Check mix.lock (fix mix deps.clean --unused --unlock)
if: matrix.elixir != '1.9.x'
run: mix deps.unlock --check-unused
- run: mix format --check-formatted
- name: Compile deps
if: steps.build-cache.outputs.cache-hit != 'true'
run: mix deps.compile
- run: mix compile --warnings-as-errors
- run: mix test
- name: Clean up unused deps (used for cache)
run: mix deps.clean --unused --unlock