-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
54 lines (47 loc) · 1.46 KB
/
.gitlab-ci.yml
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
# Reference: https://git.mel.vin/template/c/commit/584b866fe79411b3f361e79fe0c0d68a3b278b9e
image: ubuntu:24.04
stages:
- build
- test
cache:
paths:
- apt-cache/
variables:
# https://askubuntu.com/questions/909277/avoiding-user-interaction-with-tzdata-when-installing-certbot-in-a-docker-contai
DEBIAN_FRONTEND: "noninteractive"
build:
stage: build
before_script:
- apt update -qq && apt -o dir::cache::archives="apt-cache" install -y build-essential g++ g++-multilib zlib1g-dev cmake git gcovr lcov catch2
- git submodule sync --recursive
- git submodule update --init --recursive
script:
- make debug -j8
artifacts:
paths:
- bin/debug/libswf.a
- bin/debug/libswf_test
- build/*.gcno
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
cache:
paths:
- build/*.o
# run tests using the binary built before
test:
stage: test
# dependencies use only the artifacts from the specified stage
dependencies:
- build
before_script:
- apt update -qq && apt -o dir::cache::archives="apt-cache" install -y build-essential g++ g++-multilib zlib1g-dev cmake git gcovr lcov catch2
script:
- ./bin/debug/libswf_test
- gcov build/*.o
- lcov --base-directory . --directory build/ --capture --output-file coverage.info
- lcov --list coverage.info
artifacts:
paths:
- coverage.info
# Coverage badge
coverage:
'/Total:\|(\d+\.?\d+\%)/'