Update pipeline for python3 and PyYAML.
[open-adventure.git] / .gitlab-ci.yml
1 image: alpine
2
3 variables:
4   GIT_SUBMODULE_STRATEGY: "recursive"
5   GIT_SSL_NO_VERIFY: "true"
6
7 stages:
8   - build
9   - test
10   - deploy
11
12 # build advent itself
13 binary:debug:
14   stage: build
15   before_script:
16     - apk update
17     - apk add make gcc musl-dev python3 py-pip
18     - pip install PyYAML
19   script: 
20     - make debug
21   artifacts:
22     paths:
23       - advent
24       - "*.gcda"
25       - "*.gcno"
26   # cache outputs to reduce the build time
27   cache:
28     paths:
29       - "*.o"
30
31 binary:release:
32   stage: build
33   before_script:
34     - apk update
35     - apk add make gcc musl-dev python3 py-pip
36     - pip install PyYAML
37   script: 
38     - make advent
39   artifacts:
40     paths:
41       - advent
42   # cache outputs to reduce the build time
43   cache:
44     paths:
45       - "*.o"
46
47 manpage:
48   stage: build
49   before_script:
50     - apk update
51     - apk add make asciidoc
52   script:
53     - make advent.6
54   artifacts:
55     paths:
56       - advent.6
57
58 html:
59   stage: build
60   before_script:
61     - apk update
62     - apk add make asciidoc libxslt
63   script:
64     - make html
65   artifacts:
66     paths:
67       - "*.html"
68
69 dist:
70   stage: build
71   before_script:
72     - apk update
73     - apk add make asciidoc
74   script:
75     - export VERS=${CI_COMMIT_REF_NAME}
76     - make dist -e
77   artifacts:
78     paths:
79       - "*.tar.gz"
80
81 # run tests using the binary built before
82 test:debug:
83   stage: test
84   before_script:
85     - apk update
86     - apk add make gcc
87     - apk add lcov --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
88   script:
89     - cd tests
90     - make
91     - cd ..
92     - lcov -t "advent" -o advent.info -c -d .
93     - genhtml -o coverage advent.info
94   artifacts:
95     paths:
96       - coverage
97   dependencies:
98     - binary:debug
99
100 test:release:
101   stage: test
102   before_script:
103     - apk update
104     - apk add make
105   script:
106     - cd tests
107     - make
108     - cd ..
109   dependencies:
110     - binary:release
111
112 pages:
113   stage: deploy
114   script:
115     - mkdir public
116     - mv coverage public
117   artifacts:
118     paths:
119       - public
120   only:
121     - master
122   dependencies:
123     - test:debug
124