Use OpenSUSE in CI pipeline, instead
[open-adventure.git] / .gitlab-ci.yml
1 image: opensuse:tumbleweed
2
3 stages:
4   - build
5   - test
6   - deploy
7
8 # build advent itself
9 binary:debug:
10   stage: build
11   before_script:
12     - zypper install -y make gcc libedit-devel libasan3 libubsan0 python python2-PyYAML lcov 
13   script:
14     - make debug
15   artifacts:
16     paths:
17       - advent
18       - cheat
19       - "*.o"
20       - dungeon.c
21       - dungeon.h
22       - "*.gcno"
23
24 binary:release:
25   stage: build
26   before_script:
27     - zypper install -y make gcc libedit-devel python python2-PyYAML
28   script:
29     - make advent cheat
30   artifacts:
31     paths:
32       - advent
33       - cheat
34       - "*.o"
35       - dungeon.c
36       - dungeon.h
37
38 manpage:
39   stage: build
40   before_script:
41     - zypper install -y make asciidoc
42   script:
43     - make advent.6
44   artifacts:
45     paths:
46       - advent.6
47
48 html:
49   stage: build
50   before_script:
51     - zypper install -y make asciidoc libxslt
52   script:
53     - make html
54   artifacts:
55     paths:
56       - "*.html"
57
58 dist:
59   stage: build
60   before_script:
61     - zypper install -y make asciidoc tar
62   script:
63     - export VERS=${CI_COMMIT_REF_NAME}
64     - make dist -e
65   artifacts:
66     paths:
67       - "*.tar.gz"
68
69 # run tests using the binary built before
70 test:debug:
71   stage: test
72   before_script:
73     - zypper install -y make gcc libedit-devel libasan3 libubsan0 python python2-PyYAML lcov
74   script:
75     - make debug
76     - make check
77     - lcov -t "advent" -o advent.info -c -d .
78     - genhtml -o coverage advent.info
79     - cd tests
80     - ./coverage_dungeon.py
81     - cd ..
82   artifacts:
83     paths:
84       - coverage
85
86 test:release:
87   stage: test
88   before_script:
89     - zypper install -y make libedit
90   script:
91     - cd tests
92     - make
93     - cd ..
94   dependencies:
95     - binary:release
96
97 pages:
98   stage: deploy
99   script:
100     - mkdir public
101     - mv coverage public
102   artifacts:
103     paths:
104       - public
105   only:
106     - master
107   dependencies:
108     - test:debug