Typo fix.
[open-adventure.git] / .gitlab-ci.yml
1 stages:
2   - ci-build
3   - build
4   - test
5   - deploy
6
7 default:
8   image: $CI_REGISTRY_IMAGE:ci
9
10 # build and push Docker image to be used in subsequent steps
11 ci-build:
12   stage: ci-build
13   image:
14     name: gcr.io/kaniko-project/executor:debug
15     entrypoint: [""]
16   script:
17     - mkdir -p /kaniko/.docker
18     - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
19     - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.ci --destination $CI_REGISTRY_IMAGE:ci --cache=true
20
21 # build advent itself
22 binary:debug:
23   stage: build
24   script:
25     - make debug
26   artifacts:
27     paths:
28       - advent
29       - cheat
30       - "*.o"
31       - dungeon.c
32       - dungeon.h
33
34 binary:release:
35   stage: build
36   script:
37     - make advent cheat
38   artifacts:
39     paths:
40       - advent
41       - cheat
42       - "*.o"
43       - dungeon.c
44       - dungeon.h
45
46 manpage:
47   stage: build
48   script:
49     - make advent.6
50   artifacts:
51     paths:
52       - advent.6
53
54 html:
55   stage: build
56   script:
57     - make html
58   artifacts:
59     paths:
60       - "*.html"
61
62 dist:
63   stage: build
64   script:
65     - export VERS=${CI_COMMIT_REF_NAME}
66     - make dist -e
67   artifacts:
68     paths:
69       - "*.tar.gz"
70
71 # run tests using the binary built before
72 test:debug:
73   stage: test
74   script:
75     - make coverage
76   artifacts:
77     paths:
78       - coverage
79   dependencies:
80     - binary:debug
81
82 test:release:
83   stage: test
84   script:
85     - cd tests
86     - make
87     - cd ..
88   dependencies:
89     - binary:release
90
91 pages:
92   stage: deploy
93   script:
94     - mkdir public
95     - mv coverage public
96   artifacts:
97     paths:
98       - public
99   only:
100     - master
101   dependencies:
102     - test:debug