Hand merge of MR !31: Update the CI infrastructure to be faster
[open-adventure.git] / .gitlab-ci.yml
1 image: alpine
2
3 stages:
4   - build
5   - test
6
7 # build advent itself
8 binary:
9   stage: build
10   before_script:
11     - apk update
12     - apk add make gcc musl-dev
13   script: 
14     - make advent
15   artifacts:
16     paths:
17       - advent
18   # cache outputs to reduce the build time
19   cache:
20     paths:
21       - "*.o"
22
23 manpage:
24   stage: build
25   before_script:
26     - apk update
27     - apk add make asciidoc
28   script:
29     - make .asc.6
30   artifacts:
31     paths:
32       - advent.6
33
34 html:
35   stage: build
36   before_script:
37     - apk update
38     - apk add make asciidoc libxslt
39   script:
40     - make .asc.html
41   artifacts:
42     paths:
43       - advent.html
44
45 # run tests using the binary built before
46 test:
47   stage: test
48   before_script:
49     - apk update
50     - apk add make
51   script:
52     - cd tests
53     - make