Add html production for convenience generating the website.
[open-adventure.git] / .gitlab-ci.yml
index 13ad35d040fb2e7e60de55523ff1cb09ff00fd9d..1dcb6c1867340ff7762e95a3c8a358093f28b64a 100644 (file)
@@ -1,22 +1,73 @@
-image: gcc
+image: alpine
 
-# build using Makefile
-build:
+stages:
+  - build
+  - test
+  - deploy
+
+# 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:
       - 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:
-    - make check
+    - mv coverage public
+  artifacts:
+    paths:
+      - public
+  only:
+    - master