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