-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Earthfile
68 lines (45 loc) · 1.05 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# SPDX-FileCopyrightText: 2021 Rosa Richter
#
# SPDX-License-Identifier: MIT
VERSION 0.6
ARG MIX_ENV=dev
ARG ELIXIR_VERSION=1.13
all:
BUILD +lint
BUILD +lint-copyright
BUILD +test \
--ELIXIR_VERSION=1.14 \
--ELIXIR_VERSION=1.13 \
--ELIXIR_VERSION=1.12 \
--ELIXIR_VERSION=1.11
get-deps:
FROM elixir:${ELIXIR_VERSION}-alpine
RUN mix do local.rebar --force, local.hex --force
COPY mix.exs .
COPY mix.lock .
RUN mix deps.get
SAVE ARTIFACT deps AS LOCAL ./deps
compile-deps:
FROM +get-deps
RUN MIX_ENV=$MIX_ENV mix deps.compile
SAVE ARTIFACT _build/$MIX_ENV AS LOCAL ./_build/$MIX_ENV
build:
FROM +compile-deps
COPY priv ./priv
COPY lib ./lib
RUN MIX_ENV=$MIX_ENV mix compile
SAVE ARTIFACT _build/$MIX_ENV AS LOCAL ./_build/$MIX_ENV
lint:
FROM +build
RUN MIX_ENV=$MIX_ENV mix credo list
lint-copyright:
FROM fsfe/reuse
COPY . .
RUN reuse lint
lint-licenses:
FROM +build
RUN mix hex.licenses --reuse
test:
FROM --build-arg MIX_ENV=test +build
COPY test ./test
RUN MIX_ENV=test mix test