-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
46 lines (40 loc) · 1.01 KB
/
Earthfile
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
VERSION 0.8
ARG elixir_version=1.16.1
ARG otp_version=26.2.1
ARG debian_version=bookworm-20231120-slim
FROM hexpm/elixir:$elixir_version-erlang-$otp_version-debian-$debian_version
ci:
BUILD +lint
BUILD +test
lint:
FROM +lint-setup
COPY --dir lib test ./
COPY .formatter.exs ./
RUN mix format --check-formatted
RUN mix xref graph --format cycles --fail-above 76
test:
FROM +test-setup
COPY --dir lib test ./
RUN git config --global init.defaultBranch "master"
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "CI"
RUN MIX_ENV=test mix compile
WITH DOCKER
RUN mix test
END
setup-base:
RUN apt-get update && apt install -y build-essential git && apt-get clean
ENV ELIXIR_ASSERT_TIMEOUT=10000
WORKDIR /code
RUN mix local.rebar --force
RUN mix local.hex --force
COPY mix.exs .
COPY mix.lock .
RUN mix deps.get
test-setup:
FROM +setup-base
ENV MIX_ENV=test
RUN mix deps.compile
lint-setup:
FROM +setup-base
RUN mix deps.compile