-image: gcc
+image: alpine
-# build using Makefile
-build:
+stages:
+ - build
+ - test
+
+# build advent itself
+binary:
stage: build
- before_script:
- - apt update && apt -y install make
+ before_script:
+ - apk update
+ - apk add make gcc musl-dev
script:
- make advent
artifacts:
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
script:
- - make check
+ - cd tests
+ - make
cd tests; $(MAKE) --quiet
# Requires asciidoc and xsltproc/docbook stylesheets.
-.asc.6:
+.asc.6: advent.txt
a2x --doctype manpage --format manpage $<
-.asc.html:
+.asc.html: advent.txt
a2x --doctype manpage --format xhtml -D . $<
rm -f docbook-xsl.css