11VERSION 0.5
22
33all :
4- BUILD +test-all
5- BUILD +integration-test-all
6-
7-
8- test-all :
9- BUILD \
10- --build-arg ELIXIR_BASE= 1.13.4-erlang-24.3.4.2-alpine-3.16.0 \
11- --build-arg ELIXIR_BASE= 1.13.4-erlang-22.3.4.20-alpine-3.14.0 \
12- +test
13-
14-
15- test :
16- FROM +test-setup
17- RUN MIX_ENV= test mix deps.compile
18- COPY --dir bench integration_test lib test ./
19-
20- ARG LINT
21- RUN if [ "$LINT" == "lint" ]; then mix format --check-formatted ; fi
22- RUN mix deps.get && mix deps.unlock --check-unused
23- RUN mix deps.compile
24- RUN mix compile #--warnings-as-errors
25- RUN mix test
26-
27-
28- integration-test-all :
29- ARG ELIXIR_BASE= 1.13.4-erlang-24.3.4.2-alpine-3.16.0
4+ ARG ELIXIR_BASE= 1.15.6-erlang-25.3.2.6-alpine-3.17.4
305 BUILD \
316 --build-arg POSTGRES= 15.0 \
327 --build-arg POSTGRES= 11.11 \
@@ -36,33 +11,34 @@ integration-test-all:
3611
3712 BUILD \
3813 --build-arg MYSQL= 5.7 \
14+ --build-arg MYSQL= 8.0 \
3915 +integration-test-mysql
4016
4117 BUILD \
4218 --build-arg MSSQL= 2017 \
4319 --build-arg MSSQL= 2019 \
4420 +integration-test-mssql
4521
46-
47- integration-test-base :
48- FROM +setup-base
22+ setup-base :
23+ ARG ELIXIR_BASE= 1.15.6-erlang-25.3.2.6-alpine-3.17.4
24+ FROM hexpm/elixir:$ELIXIR_BASE
25+ RUN apk add --no-progress --update git build-base
26+ ENV ELIXIR_ASSERT_TIMEOUT= 10000
27+ WORKDIR /src/ecto_sql
4928 RUN apk add --no-progress --update docker docker-compose
50-
5129 RUN mix local.rebar --force
5230 RUN mix local.hex --force
5331
54-
55- COMMON_INTEGRATION_SETUP_AND_MIX :
32+ COMMON_SETUP_AND_MIX :
5633 COMMAND
5734 COPY mix.exs mix.lock .formatter.exs .
5835 COPY --dir bench integration_test lib test ./
5936 RUN mix deps.get
6037 RUN mix deps.compile
6138 RUN mix compile #--warnings-as-errors
6239
63-
6440integration-test-postgres :
65- FROM +integration-test -base
41+ FROM +setup -base
6642 ARG POSTGRES= "11.11"
6743
6844 IF [ "$POSTGRES" = "9.5" ]
@@ -82,7 +58,7 @@ integration-test-postgres:
8258 RUN apk add postgresql-client
8359 END
8460
85- DO +COMMON_INTEGRATION_SETUP_AND_MIX
61+ DO +COMMON_SETUP_AND_MIX
8662
8763 # then run the tests
8864 WITH DOCKER \
@@ -100,12 +76,11 @@ integration-test-postgres:
10076 PG_URL= postgres:postgres@127.0.0.1 ECTO_ADAPTER= pg mix test;
10177 END
10278
103-
10479integration-test-mysql :
105- FROM +integration-test -base
80+ FROM +setup -base
10681 RUN apk add mysql-client
10782
108- DO +COMMON_INTEGRATION_SETUP_AND_MIX
83+ DO +COMMON_SETUP_AND_MIX
10984
11085 ARG MYSQL= "5.7"
11186 WITH DOCKER \
@@ -128,7 +103,7 @@ integration-test-mysql:
128103
129104
130105integration-test-mssql :
131- FROM +integration-test -base
106+ FROM +setup -base
132107
133108 RUN apk add --no-cache curl gnupg --virtual .build-dependencies -- && \
134109 curl -O https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.5.2.1-1_amd64.apk && \
@@ -137,7 +112,7 @@ integration-test-mssql:
137112 apk del .build-dependencies && rm -f msodbcsql*.sig mssql-tools*.apk
138113 ENV PATH= "/opt/mssql-tools/bin:${PATH}"
139114
140- DO +COMMON_INTEGRATION_SETUP_AND_MIX
115+ DO +COMMON_SETUP_AND_MIX
141116
142117 ARG MSSQL= "2017"
143118 WITH DOCKER \
@@ -154,21 +129,3 @@ integration-test-mssql:
154129 # run tests
155130 ECTO_ADAPTER= tds mix test;
156131 END
157-
158-
159- setup-base :
160- ARG ELIXIR_BASE= 1.13.4-erlang-24.3.4.2-alpine-3.17.0
161- FROM hexpm/elixir:$ELIXIR_BASE
162- RUN apk add --no-progress --update git build-base
163- ENV ELIXIR_ASSERT_TIMEOUT= 10000
164- WORKDIR /src/ecto_sql
165-
166-
167- test-setup :
168- FROM +setup-base
169- COPY mix.exs .
170- COPY mix.lock .
171- COPY .formatter.exs .
172- RUN mix local.rebar --force
173- RUN mix local.hex --force
174- RUN mix deps.get
0 commit comments