-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
158 lines (145 loc) · 4.17 KB
/
.gitlab-ci.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
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
image: registry.gitlab.com/aaronrenner/docker-asdf
variables:
LANG: C.UTF-8
MIX_HOME: "$CI_PROJECT_DIR/.mix"
ASDF_DATA_DIR: "$CI_PROJECT_DIR/.asdf"
stages:
- install
- build
- test
before_script:
- . ~/.asdf/asdf.sh
# Ensure the timestamp doesn't change from when the repo was
# originally checked out, so we don't have to recompile for each job.
- |
if [ -f ".cloned_at" ]; then
git ls-files | xargs touch --date "$(cat .cloned_at)";
fi
install_asdf_env_and_deps:
stage: install
cache:
key: install
paths:
- $ASDF_DATA_DIR
- $MIX_HOME
script:
- asdf plugin-add erlang || true
- asdf plugin-add elixir || true
# Have to run twice due to: https://github.com/asdf-vm/asdf-erlang/issues/57
- asdf install && asdf install
- mix local.hex --force
- mix local.rebar --force
# Cache the timestamp the repo was originally checked out, so it can
# be set back to this in later jobs and allows us to skip unnecessary
# recompiles.
- stat -c "%y" README.md > .cloned_at
artifacts:
expire_in: 2 hrs
paths:
- $ASDF_DATA_DIR
- $MIX_HOME
- .cloned_at
.build:
stage: build
cache:
key: $CI_JOB_NAME
paths:
- "*/_build"
- "*/deps"
script:
- make install_deps compile
dependencies:
- install_asdf_env_and_deps
artifacts:
expire_in: 2 hrs
paths:
- "*/_build"
- "*/deps"
build:dev:
extends: .build
build:test:
extends: .build
variables:
MIX_ENV: test
unit_tests:
stage: test
script: make test
dependencies:
- install_asdf_env_and_deps
- build:test
linters:
stage: test
script:
- make check_format
- make check_unused_deps
dependencies:
- install_asdf_env_and_deps
- build:dev
dialyzer:adafruit_io_http_client:
stage: test
variables:
DIALYZER_ADAFRUIT_IO_HTTP_CLIENT_CACHE_VERSION: 1
# --format short can't be used here due to: https://github.com/jeremyjh/dialyxir/issues/314
# --list-unused-filters must be used as a command line option instead of in
# mix.exs due to: https://github.com/jeremyjh/dialyxir/issues/313
script: make dialyzer_adafruit_io_http_client
cache:
key: $CI_JOB_NAME-$DIALYZER_ADAFRUIT_IO_HTTP_CLIENT_CACHE_VERSION
paths:
- "*/_build/dev/*.plt"
- "*/_build/dev/*.plt.hash"
- $MIX_HOME/*.plt
dependencies:
- install_asdf_env_and_deps
- build:dev
dialyzer:fe_reporting:
stage: test
variables:
DIALYZER_FE_REPORTING_CACHE_VERSION: 1
# --format short can't be used here due to: https://github.com/jeremyjh/dialyxir/issues/314
# --list-unused-filters must be used as a command line option instead of in
# mix.exs due to: https://github.com/jeremyjh/dialyxir/issues/313
script: make dialyzer_fe_reporting
cache:
key: $CI_JOB_NAME-$DIALYZER_FE_REPORTING_CACHE_VERSION
paths:
- "*/_build/dev/*.plt"
- "*/_build/dev/*.plt.hash"
- $MIX_HOME/*.plt
dependencies:
- install_asdf_env_and_deps
- build:dev
dialyzer:fe_test_helpers:
stage: test
variables:
DIALYZER_FE_TEST_HELPERS_CACHE_VERSION: 1
# --format short can't be used here due to: https://github.com/jeremyjh/dialyxir/issues/314
# --list-unused-filters must be used as a command line option instead of in
# mix.exs due to: https://github.com/jeremyjh/dialyxir/issues/313
script: make dialyzer_fe_test_helpers
cache:
key: $CI_JOB_NAME-$DIALYZER_FE_TEST_HELPERS_CACHE_VERSION
paths:
- "*/_build/dev/*.plt"
- "*/_build/dev/*.plt.hash"
- $MIX_HOME/*.plt
dependencies:
- install_asdf_env_and_deps
- build:dev
dialyzer:freezer_eye:
stage: test
variables:
DIALYZER_FREEZER_EYE_CACHE_VERSION: 1
# --format short can't be used here due to: https://github.com/jeremyjh/dialyxir/issues/314
# --list-unused-filters must be used as a command line option instead of in
# mix.exs due to: https://github.com/jeremyjh/dialyxir/issues/313
script: make dialyzer_freezer_eye
cache:
key: $CI_JOB_NAME-$DIALYZER_FREEZER_EYE_CACHE_VERSION
paths:
- "*/_build/dev/*.plt"
- "*/_build/dev/*.plt.hash"
- $MIX_HOME/*.plt
dependencies:
- install_asdf_env_and_deps
- build:dev