forked from greaka/gw2lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
78 lines (56 loc) · 1.77 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
69
70
71
72
73
74
75
76
77
78
VERSION 0.6
FROM earthly/dind:ubuntu
tools:
RUN apt-get update
RUN apt-get install -y --no-install-recommends build-essential
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo --color=always install cargo-nextest --locked
SAVE IMAGE --cache-hint tools
prefetch:
FROM +tools
COPY Cargo.toml ./
COPY model/Cargo.toml ./model/
COPY http/Cargo.toml ./http/
COPY keys/Cargo.toml ./keys/
RUN cargo --color=always fetch
SAVE IMAGE prefetch
build-tests:
FROM +prefetch
DO +COPY_SRC
RUN cargo --color=always nextest archive --archive-file tests.tar.zst --features=blocking,redis
SAVE ARTIFACT tests.tar.zst /tests.tar.zst
test:
FROM +tools
DO +BASE_TESTS
WITH DOCKER --compose integration-compose.yml
RUN --secret GW2_API_KEY --secret GW2_TESTING_CHAR --no-cache cargo --color=always \
nextest run --archive-file tests.tar.zst
END
test-ignored:
FROM +tools
DO +BASE_TESTS
WITH DOCKER --compose integration-compose.yml
RUN --secret GW2_API_KEY --secret GW2_TESTING_CHAR --no-cache cargo --color=always \
nextest run --archive-file tests.tar.zst --run-ignored ignored-only
END
test-all:
FROM +tools
DO +BASE_TESTS
WITH DOCKER --compose integration-compose.yml
RUN --secret GW2_API_KEY --secret GW2_TESTING_CHAR --no-cache cargo --color=always \
nextest run --archive-file tests.tar.zst && \
cargo --color=always nextest run --archive-file tests.tar.zst --run-ignored ignored-only
END
BASE_TESTS:
COMMAND
COPY integration-compose.yml ./
COPY Cargo.toml ./
DO +COPY_SRC
COPY +build-tests/tests.tar.zst ./
COPY_SRC:
COMMAND
COPY --dir .config ./
COPY --dir http ./
COPY --dir model ./
COPY --dir keys ./