-
-
Notifications
You must be signed in to change notification settings - Fork 33
185 lines (181 loc) · 5.89 KB
/
ci.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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
---
# See more:
# https://hashrocket.com/blog/posts/build-the-ultimate-elixir-ci-with-github-actions
name: CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
internal_dialyzer:
runs-on: ubuntu-20.04
timeout-minutes: 30
name: Internal Typespecs
env:
OTP: "25.3"
ELIXIR: "1.13"
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP }}
elixir-version: ${{ env.ELIXIR }}
- uses: actions/cache@v2
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v2
id: build-cache
with:
path: _build
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v1
id: plt-cache
with:
path: priv/plts
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- run: mix dialyzer --force-check
credo:
runs-on: ubuntu-20.04
name: Code Style
env:
OTP: "25.3"
ELIXIR: "1.13"
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP }}
elixir-version: ${{ env.ELIXIR }}
- uses: actions/cache@v2
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v2
id: build-cache
with:
path: _build
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- run: mix credo
formatter:
runs-on: ubuntu-20.04
name: Code Formatting
env:
OTP: "25.3"
ELIXIR: "1.13"
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP }}
elixir-version: ${{ env.ELIXIR }}
- uses: actions/cache@v2
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v2
id: build-cache
with:
path: _build
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- run: mix format --check-formatted
external_dialyzer:
runs-on: ubuntu-20.04
timeout-minutes: 30
name: External Typespecs
env:
OTP: "25.3"
ELIXIR: "1.13"
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP }}
elixir-version: ${{ env.ELIXIR }}
- uses: actions/cache@v2
id: mix-cache
with:
path: test/integration/deps
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-mix-ext-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v2
id: build-cache
with:
path: test/integration/_build
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-build-ext-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v1
id: plt-cache
with:
path: test/integration/priv/plts
key: ${{ runner.os }}-${{ env.OTP }}-${{ env.ELIXIR }}-plts-ext-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- working-directory: test/integration
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- if: steps.plt-cache.outputs.cache-hit != 'true'
working-directory: test/integration
run: |
mkdir -p priv/plts
mix dialyzer --plt
- working-directory: test/integration
run: mix dialyzer --force-check
test:
runs-on: ubuntu-20.04
name: OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }}
strategy:
fail-fast: true
# NOTE: We are going to support 4 version from the official list of 5
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html
matrix:
otp: ["25.3"]
elixir: ["1.13.4"]
include:
- otp: "26.2"
elixir: "1.14.5"
- otp: "26.2"
elixir: "1.15.8"
- otp: "26.2"
elixir: "1.16.3"
- otp: "27.0"
elixir: "1.17.1"
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- uses: actions/cache@v2
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- uses: actions/cache@v2
id: build-cache
with:
path: _build
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- run: mix test