~cosmicrose/liberator

liberator/Earthfile -rw-r--r-- 1002 bytes
ef0bcd1aRosa Richter Remove FUNDING, use my global .github repo 4 months ago
                                                                                
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
# SPDX-FileCopyrightText: 2021 Rosa Richter
#
# SPDX-License-Identifier: MIT

ARG MIX_ENV=dev

all:
  BUILD +lint
  BUILD +lint-copyright
  BUILD +test

get-deps:
  FROM elixir:1.12-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 config ./config
  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-hex-licenses:
  FROM +build

  RUN mix licenses.lint --reuse

sast:
  FROM +build

  RUN MIX_ENV=$MIX_ENV mix sobelow --skip

test:
  FROM --build-arg MIX_ENV=test +build

  COPY test ./test

  RUN MIX_ENV=test mix test