open-adventure/.gitlab-ci.yml

73 lines
1.2 KiB
YAML

image: alpine
stages:
- build
- test
- deploy
# build advent itself
binary:
stage: build
before_script:
- apk update
- apk add make gcc musl-dev
script:
- make advent
artifacts:
paths:
- advent
- "*.gcda"
- "*.gcno"
# cache outputs to reduce the build time
cache:
paths:
- "*.o"
manpage:
stage: build
before_script:
- apk update
- apk add make asciidoc
script:
- make .asc.6
artifacts:
paths:
- advent.6
html:
stage: build
before_script:
- apk update
- apk add make asciidoc libxslt
script:
- make .asc.html
artifacts:
paths:
- advent.html
# run tests using the binary built before
test:
stage: test
before_script:
- apk update
- apk add make gcc
- apk add lcov --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
script:
- cd tests
- make
- cd ..
- lcov -t "advent" -o advent.info -c -d .
- genhtml -o coverage advent.info
artifacts:
paths:
- coverage
pages:
stage: deploy
script:
- mv coverage public
artifacts:
paths:
- public
only:
- master