-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (113 loc) · 3.5 KB
/
test.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: 'Test'
on:
push:
branches:
- 'main'
- 'dev'
- 'release/**'
- 'paper/**'
pull_request:
branches:
- 'main'
- 'dev'
- 'release/**'
- 'paper/**'
jobs:
skip_check:
name: 'Skip check'
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- name: 'Skip check'
id: skip_check
uses: fkirc/[email protected]
linux:
name: 'Test on Ubuntu'
needs: skip_check
runs-on: ubuntu-latest
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
container:
image: erlang:latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Extract branch name'
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
id: branch
- name: 'Extract OTP release'
run: echo "::set-output name=otp_release::$(erl -eval 'erlang:display(list_to_integer(erlang:system_info(otp_release))), halt().' -noshell)"
id: otp_release
- name: 'Cache Dialyzer PLTs'
uses: actions/cache@v2
with:
path: |
~/.cache/rebar3/rebar3_*_plt
_build/default/rebar3_*_plt
key: |
${{ runner.os }}-${{ steps.branch.outputs.branch }}-otp-${{ steps.otp_release.outputs.otp_release }}-plt-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }}
restore-keys: |
${{ runner.os }}-${{ steps.branch.outputs.branch }}-otp-${{ steps.otp_release.outputs.otp_release }}-plt-
- name: 'Cache Hex packages'
uses: actions/cache@v2
with:
path: |
~/.cache/rebar3/hex/hexpm/packages
key: |
${{ runner.os }}-${{ steps.branch.outputs.branch }}-otp-${{ steps.otp_release.outputs.otp_release }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
restore-keys: |
${{ runner.os }}-${{ steps.branch.outputs.branch }}-otp-${{ steps.otp_release.outputs.otp_release }}-hex-
- name: 'Compile'
run: rebar3 compile
- name: 'Dialyzer'
run: rebar3 dialyzer
- name: 'XRef'
run: rebar3 xref
- name: 'Lint'
run: rebar3 lint
- name: 'Check Formatting'
run: rebar3 fmt --check
- name: 'EUnit Tests'
run: rebar3 eunit
- name: 'Common Tests'
run: rebar3 ct
macos:
name: 'Test on MacOS'
needs: skip_check
runs-on: macos-latest
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Brew Version Check'
run: brew --version
- name: 'Keep Brew Fresh'
run: brew update
- name: 'Install Erlang'
run: brew install erlang
- name: 'Install rebar3'
run: brew install rebar3
- name: 'Compile'
run: rebar3 compile
- name: 'EUnit Tests'
run: rebar3 eunit
- name: 'Common Tests'
run: rebar3 ct
windows:
name: 'Test on Windows'
needs: skip_check
runs-on: windows-latest
if: ${{ needs.skip_check.outputs.should_skip != 'true' }}
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Install Erlang'
run: choco install erlang
- name: 'Install rebar3'
run: choco install rebar3
- name: 'Compile'
run: rebar3 compile
- name: 'EUnit Tests'
run: rebar3 eunit
- name: 'Common Tests'
run: rebar3 ct