1dcb6c1867340ff7762e95a3c8a358093f28b64a
[open-adventure.git] / .gitlab-ci.yml
1 image: alpine
2
3 stages:
4   - build
5   - test
6   - deploy
7
8 # build advent itself
9 binary:
10   stage: build
11   before_script:
12     - apk update
13     - apk add make gcc musl-dev
14   script: 
15     - make advent
16   artifacts:
17     paths:
18       - advent
19       - "*.gcda"
20       - "*.gcno"
21   # cache outputs to reduce the build time
22   cache:
23     paths:
24       - "*.o"
25
26 manpage:
27   stage: build
28   before_script:
29     - apk update
30     - apk add make asciidoc
31   script:
32     - make .asc.6
33   artifacts:
34     paths:
35       - advent.6
36
37 html:
38   stage: build
39   before_script:
40     - apk update
41     - apk add make asciidoc libxslt
42   script:
43     - make .asc.html
44   artifacts:
45     paths:
46       - advent.html
47
48 # run tests using the binary built before
49 test:
50   stage: test
51   before_script:
52     - apk update
53     - apk add make gcc
54     - apk add lcov --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
55   script:
56     - cd tests
57     - make
58     - cd ..
59     - lcov -t "advent" -o advent.info -c -d .
60     - genhtml -o coverage advent.info
61   artifacts:
62     paths:
63       - coverage
64
65 pages:
66   stage: deploy
67   script:
68     - mv coverage public
69   artifacts:
70     paths:
71       - public
72   only:
73     - master