Attempt YAML repair.
[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:debug:
10   stage: build
11   before_script:
12     - apk update
13     - apk add make gcc musl-dev
14   script: 
15     - make debug
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 binary:release:
27   stage: build
28   before_script:
29     - apk update
30     - apk add make gcc musl-dev
31   script: 
32     - make advent
33   artifacts:
34     paths:
35       - advent
36   # cache outputs to reduce the build time
37   cache:
38     paths:
39       - "*.o"
40
41 manpage:
42   stage: build
43   before_script:
44     - apk update
45     - apk add make asciidoc
46   script:
47     - make advent.6
48   artifacts:
49     paths:
50       - advent.6
51
52 html:
53   stage: build
54   before_script:
55     - apk update
56     - apk add make asciidoc libxslt
57   script:
58     - make html
59   artifacts:
60     paths:
61       - "*.html"
62
63 # run tests using the binary built before
64 test:debug:
65   stage: test
66   before_script:
67     - apk update
68     - apk add make gcc
69     - apk add lcov --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
70   script:
71     - cd tests
72     - make
73     - cd ..
74     - lcov -t "advent" -o advent.info -c -d .
75     - genhtml -o coverage advent.info
76   artifacts:
77     paths:
78       - coverage
79   dependencies:
80     - binary:debug
81
82 test:release:
83   stage: test
84   before_script:
85     - apk update
86     - apk add make
87   script:
88     - cd tests
89     - make
90     - cd ..
91   dependencies:
92     - binary:release
93
94 pages:
95   stage: deploy
96   script:
97     - mkdir public
98     - mv coverage public
99     - "mv *.html public"
100   artifacts:
101     paths:
102       - public
103   only:
104     - master
105   dependencies:
106     - html
107     - test:debug
108
109 package:
110   stage: deploy
111   script:
112     - cp README.adoc README
113   artifacts:
114     paths:
115       - advent
116       - NEWS
117       - COPYING
118       - README
119       - advent.6
120   dependencies:
121     - binary:release
122     - manpage