This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Earthfile
58 lines (48 loc) · 1.73 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
FROM debian:buster-slim
WORKDIR /libhelium
debian-deps:
RUN apt-get update
RUN apt-get -y install build-essential git automake m4 libtool-bin cmake ruby-full python3-pip
RUN gem install ceedling --no-user-install
RUN pip3 install gcovr
libhelium-deps:
FROM +debian-deps
# Copy in the build configs
COPY *.yml .
# Make the directory structure so that the config can be parsed
# To improve caching we want to separate this out as the WolfSSL dependency
# fetch and build are the slowest parts of the process.
RUN mkdir -p src include test/support third_party/wolfssl
# Build and fetch the dependencies
RUN ceedling dependencies:make project:linux
build:
FROM +libhelium-deps
# Copy in the source and include files
COPY --dir src include ./
# Generate the release
RUN ceedling release project:linux
# Store the artifacts
SAVE ARTIFACT build/release/libhelium.a ./libhelium.a AS LOCAL ./artifacts/libhelium.a
SAVE ARTIFACT build/artifacts/compile_commands.json /compile_commands.json
test-copy:
FROM +build
COPY --dir test ./
test:
FROM +test-copy
# Run the tests
RUN ceedling test project:linux
coverage:
FROM +test-copy
# Generate code coverage
RUN ceedling gcov:all utils:gcov project:linux
SAVE ARTIFACT build/artifacts/gcov/*.html AS LOCAL ./artifacts/code_coverage/html/
SAVE ARTIFACT build/artifacts/gcov/*.xml AS LOCAL ./artifacts/code_coverage/xml/
compile-commands:
FROM +build
# Copy and write out the compile_commands.json for IDE code completion support
COPY +build/compile_commands.json .
SAVE ARTIFACT compile_commands.json AS LOCAL compile_commands.json
all:
BUILD +test
BUILD +coverage
BUILD +build