-
Notifications
You must be signed in to change notification settings - Fork 13
235 lines (222 loc) · 8.45 KB
/
ci.yml
File metadata and controls
235 lines (222 loc) · 8.45 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
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: Continuous Integration
on: [push, pull_request]
env:
CACHE_VERSION: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
test:
runs-on: ubuntu-latest
env:
MIX_ENV: "test"
ELIXIR_VERSION: ${{ matrix.elixir }}
OTP_VERSION: ${{ matrix.otp }}
strategy:
fail-fast: false
matrix:
elixir: ["1.12.3", "1.11.4", "1.10.4", "1.9.4", "1.8.2"]
include:
- elixir: "1.12.3"
otp: "24.0.6"
check_formatting: true
- elixir: "1.11.4"
otp: "24.0.6"
check_formatting: true
- elixir: "1.10.4"
otp: "23.3.4.7"
check_formatting: false
- elixir: "1.9.4"
otp: "22.3.4.21"
check_formatting: false
- elixir: "1.8.2"
otp: "22.3.4.21"
check_formatting: false
steps:
- uses: actions/checkout@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Cache deps
uses: actions/cache@v1
with:
path: deps
key: ${{ env.CACHE_VERSION }}-deps-build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
- name: Cache _build
uses: actions/cache@v1
with:
path: _build/${{ env.MIX_ENV }}
key: ${{ env.CACHE_VERSION }}-_build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-
- name: Install Dependencies
run: mix deps.get
- name: Compile app
run: mix compile --force --warnings-as-errors
- run: mix coveralls.json
- name: Upload results to CodeCov
run: bash <(curl -s https://codecov.io/bash) -F UnitTest -e ELIXIR_VERSION,OTP_VERSION || echo "Codecov did not collect coverage reports"
- run: mix format --check-formatted
if: matrix.check_formatting
- run: mix credo --strict
- name: Check for unused dependencies
run: mix deps.unlock --unused && git diff --exit-code
dialyzer:
runs-on: ubuntu-latest
env:
MIX_ENV: "dev"
strategy:
fail-fast: false
matrix:
elixir: ["1.12.3", "1.11.4", "1.10.4", "1.9.4", "1.8.2"]
include:
- elixir: "1.12.3"
otp: "24.0.6"
- elixir: "1.11.4"
otp: "24.0.6"
- elixir: "1.10.4"
otp: "23.3.4.7"
- elixir: "1.9.4"
otp: "22.3.4.21"
- elixir: "1.8.2"
otp: "22.3.4.21"
steps:
- uses: actions/checkout@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- uses: actions/cache@v1
with:
path: deps
key: ${{ env.CACHE_VERSION }}-deps-build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
- uses: actions/cache@v1
with:
path: _build/${{ env.MIX_ENV }}
key: ${{ env.CACHE_VERSION }}-_build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-dialyzer
restore-keys: |
${{ env.CACHE_VERSION }}-_build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-
- name: Install Dependencies
run: mix deps.get
- name: Compile app
run: mix compile --force --warnings-as-errors
- name: Build PLT
run: mix dialyzer --plt
- name: Dialyzer
run: mix dialyzer --format short
integration_tests:
runs-on: ubuntu-latest
env:
MIX_ENV: "test"
ELIXIR_VERSION: ${{ matrix.elixir }}
OTP_VERSION: ${{ matrix.otp }}
strategy:
fail-fast: false
matrix:
elixir:
- "1.12.3"
- "1.11.4"
- "1.10.4"
- "1.9.4"
- "1.8.2"
include:
- elixir: "1.12.3"
otp: "24.0.6"
- elixir: "1.11.4"
otp: "24.0.6"
- elixir: "1.10.4"
otp: "23.3.4.7"
- elixir: "1.9.4"
otp: "22.3.4.21"
- elixir: "1.8.2"
otp: "22.3.4.21"
services:
# Allow accessing localhost ports from docker containers.
# See https://github.com/qoomon/docker-host
dockerhost:
image: qoomon/docker-host
options: >-
--cap-add=NET_ADMIN
--cap-add=NET_RAW
--restart on-failure
selenium-3-chrome:
image: selenium/standalone-chrome:3
ports:
- "4445:4444"
options: >-
--shm-size=2g
selenium-3-firefox:
image: selenium/standalone-firefox:3
ports:
- "4446:4444"
options: >-
--shm-size=2g
selenium-2-chrome:
image: selenium/standalone-chrome:2.53.1
ports:
- "4447:4444"
options: >-
--shm-size=2g
selenium-2-firefox:
image: selenium/standalone-firefox:2.53.1
ports:
- "4448:4444"
options: >-
--shm-size=2g
steps:
- uses: actions/checkout@v1
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- run: mkdir -p logs
- name: Run PhantomJS
run: phantomjs --wd --webdriver-logfile=logs/phantomjs.log --webdriver-loglevel=DEBUG --debug=true &> logs/phantomjs-output.log &
- name: Run chromedriver
run: chromedriver --log-path=logs/chromedriver.log --log-level=DEBUG &
- uses: actions/cache@v1
with:
path: deps
key: ${{ env.CACHE_VERSION }}-deps-build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
- uses: actions/cache@v1
with:
path: _build/${{ env.MIX_ENV }}
key: ${{ env.CACHE_VERSION }}-_build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-integration-tests
restore-keys: |
${{ env.CACHE_VERSION }}-_build-${{ env.MIX_ENV }}-${{ matrix.otp }}-${{ matrix.elixir }}-
- name: Install Dependencies
run: mix deps.get
- name: Compile app
run: mix compile --force --warnings-as-errors
- run: mix coveralls.json --only integration_test_driver:chromedriver
- name: Upload results to CodeCov
run: bash <(curl -s https://codecov.io/bash) -F IntegrationTest -F Chromedriver -e ELIXIR_VERSION,OTP_VERSION || echo "Codecov did not collect coverage reports"
- run: mix coveralls.json --only integration_test_driver:phantomjs
- name: Upload results to CodeCov
run: bash <(curl -s https://codecov.io/bash) -F IntegrationTest -F Phantomjs -e ELIXIR_VERSION,OTP_VERSION || echo "Codecov did not collect coverage reports"
- run: mix coveralls.json --only integration_test_driver_browser:selenium_3-chrome
env:
TEST_SERVER_HOSTNAME: dockerhost
WEBDRIVER_BASE_URL: http://localhost:4445/wd/hub
- name: Upload results to CodeCov
run: bash <(curl -s https://codecov.io/bash) -F IntegrationTest -F Selenium3Chrome -e ELIXIR_VERSION,OTP_VERSION || echo "Codecov did not collect coverage reports"
- run: mix coveralls.json --only integration_test_driver_browser:selenium_3-firefox
env:
TEST_SERVER_HOSTNAME: dockerhost
WEBDRIVER_BASE_URL: http://localhost:4446/wd/hub
- name: Upload results to CodeCov
run: bash <(curl -s https://codecov.io/bash) -F IntegrationTest -F Selenium3Firefox -e ELIXIR_VERSION,OTP_VERSION || echo "Codecov did not collect coverage reports"
- run: mix coveralls.json --only integration_test_driver_browser:selenium_2-chrome
env:
TEST_SERVER_HOSTNAME: dockerhost
WEBDRIVER_BASE_URL: http://localhost:4447/wd/hub
- name: Upload results to CodeCov
run: bash <(curl -s https://codecov.io/bash) -F IntegrationTest -F Selenium2Chrome -e ELIXIR_VERSION,OTP_VERSION || echo "Codecov did not collect coverage reports"
- run: mix coveralls.json --only integration_test_driver_browser:selenium_2-firefox
env:
TEST_SERVER_HOSTNAME: dockerhost
WEBDRIVER_BASE_URL: http://localhost:4448/wd/hub
- name: Upload results to CodeCov
run: bash <(curl -s https://codecov.io/bash) -F IntegrationTest -F Selenium2Firefox -e ELIXIR_VERSION,OTP_VERSION || echo "Codecov did not collect coverage reports"
- uses: actions/upload-artifact@v1
if: always()
with:
name: Integration test server logs (Elixir ${{matrix.elixir}})
path: logs/