Skip to content

Commit 8a2359c

Browse files
committed
Add CI build script
1 parent a5aabfd commit 8a2359c

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

.gitlab-ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
image: registry.gitlab.com/aaronrenner/docker-asdf
2+
3+
variables:
4+
LANG: C.UTF-8
5+
MIX_HOME: "$CI_PROJECT_DIR/.mix"
6+
ASDF_DATA_DIR: "$CI_PROJECT_DIR/.asdf"
7+
8+
stages:
9+
- install
10+
- build
11+
- test
12+
13+
before_script:
14+
- . ~/.asdf/asdf.sh
15+
16+
install_asdf_env_and_deps:
17+
stage: install
18+
cache:
19+
key: install
20+
paths:
21+
- $ASDF_DATA_DIR
22+
- $MIX_HOME
23+
- deps
24+
script:
25+
- asdf plugin-add erlang || true
26+
- asdf plugin-add elixir || true
27+
# Have to run twice due to: https://github.com/asdf-vm/asdf-erlang/issues/57
28+
- asdf install && asdf install
29+
- mix local.hex --force
30+
- mix local.rebar --force
31+
- (cd freezer_eye && mix do deps.clean --unused, deps.get)
32+
artifacts:
33+
paths:
34+
- $ASDF_DATA_DIR
35+
- $MIX_HOME
36+
- freezer_eye/deps
37+
38+
build:dev:
39+
stage: build
40+
cache:
41+
key: $CI_JOB_NAME
42+
paths:
43+
- freezer_eye/_build
44+
script:
45+
- (cd freezer_eye && mix compile --warnings-as-errors)
46+
dependencies:
47+
- install_asdf_env_and_deps
48+
artifacts:
49+
paths:
50+
- _build
51+
52+
build:test:
53+
stage: build
54+
cache:
55+
key: $CI_JOB_NAME
56+
paths:
57+
- _build
58+
script:
59+
- (cd freezer_eye && MIX_ENV=test mix compile --warnings-as-errors)
60+
dependencies:
61+
- install_asdf_env_and_deps
62+
artifacts:
63+
paths:
64+
- _build
65+
66+
unit_tests:
67+
stage: test
68+
script: (cd freezer_eye && mix test)
69+
dependencies:
70+
- install_asdf_env_and_deps
71+
- build:test
72+
73+
linters:
74+
stage: test
75+
script:
76+
- (cd freezer_eye && mix format --check-formatted)
77+
- (cd freezer_eye && mix deps.unlock --unused && git diff --exit-code)
78+
dependencies:
79+
- install_asdf_env_and_deps
80+
- build:dev

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
elixir 1.8.1-otp-21
2+
erlang 21.3.6

0 commit comments

Comments
 (0)