-
Notifications
You must be signed in to change notification settings - Fork 10
83 lines (79 loc) · 2.67 KB
/
build-workflow.yaml
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
83
name: Build and Test
on:
# Run when pushing to stable branches
push:
branches:
- 'master'
- 'release-*'
# Run on branch/tag creation
create:
# Run on pull requests
pull_request:
env:
elixir_version: 1.11.4
otp_version: 23.2
jobs:
test-dialyzer:
name: Check Dialyzer
runs-on: ubuntu-20.04
env:
MIX_ENV: ci
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: deps
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v1
with:
path: _build
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v1
with:
path: dialyzer_cache
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-dialyzer_cache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-dialyzer_cache-
- uses: erlef/setup-beam@v1.7.0
with:
otp-version: ${{ env.otp_version }}
elixir-version: ${{ env.elixir_version }}
- name: Install Dependencies
run: mix deps.get
- name: Run dialyzer
# FIXME: This should be set to fail when dialyzer issues are fixed
run: mix dialyzer || exit 0
test-coverage:
name: Build and Test
runs-on: ubuntu-20.04
# Wait for Dialyzer to give it a go before building
needs:
- test-dialyzer
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: deps
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v1
with:
path: _build
key: ${{ runner.os }}-${{ env.elixir_version }}-${{ env.otp_version }}-_build-${{ github.sha }}
- uses: erlef/setup-beam@v1.7.0
with:
otp-version: ${{ env.otp_version }}
elixir-version: ${{ env.elixir_version }}
- name: Install Dependencies
run: mix deps.get
- name: Check formatting
run: mix format --check-formatted
- name: Compile
run: mix do compile
- name: Test and Coverage
run: mix coveralls.json --exclude wip -o coverage_results
- name: Upload coverage report
uses: codecov/codecov-action@v1