Step with debug compiling with Clang, to contrast with GCC
[open-adventure.git] / .gitlab-ci.yml
index 13004d5f0bb7a24f76b44ccddbb7b25c1187d10a..3644753c5d709b2e1bd3ae77d8fa0b2e1fd331f1 100644 (file)
@@ -1,32 +1,45 @@
-image: alpine
+image: opensuse:tumbleweed
 
 stages:
   - build
   - test
+  - deploy
 
 # build advent itself
-binary:
+binary:debug:
   stage: build
   before_script:
-    - apk update
-    - apk add make gcc musl-dev
-  script: 
-    - make advent
+    - zypper install -y make gcc libedit-devel libasan3 libubsan0 python python2-PyYAML lcov 
+  script:
+    - make debug
   artifacts:
     paths:
       - advent
-  # cache outputs to reduce the build time
-  cache:
+      - cheat
+      - "*.o"
+      - dungeon.c
+      - dungeon.h
+
+binary:release:
+  stage: build
+  before_script:
+    - zypper install -y make gcc libedit-devel python python2-PyYAML
+  script:
+    - make advent cheat
+  artifacts:
     paths:
+      - advent
+      - cheat
       - "*.o"
+      - dungeon.c
+      - dungeon.h
 
 manpage:
   stage: build
   before_script:
-    - apk update
-    - apk add make asciidoc
+    - zypper install -y make asciidoc
   script:
-    - make .asc.6
+    - make advent.6
   artifacts:
     paths:
       - advent.6
@@ -34,20 +47,64 @@ manpage:
 html:
   stage: build
   before_script:
-    - apk update
-    - apk add make asciidoc libxslt
+    - zypper install -y make asciidoc libxslt
+  script:
+    - make html
+  artifacts:
+    paths:
+      - "*.html"
+
+dist:
+  stage: build
+  before_script:
+    - zypper install -y make asciidoc tar
   script:
-    - make .asc.html
+    - export VERS=${CI_COMMIT_REF_NAME}
+    - make dist -e
   artifacts:
     paths:
-      - advent.html
+      - "*.tar.gz"
 
 # run tests using the binary built before
-test:
+test:debug:
   stage: test
   before_script:
-    - apk update
-    - apk add make
+    - zypper install -y make gcc libedit-devel libasan3 libubsan0 python python2-PyYAML lcov
+  script:
+    - make coverage
+  artifacts:
+    paths:
+      - coverage
+  dependencies:
+    - binary:debug
+
+test:debug_clang:
+  stage: test
+  before_script:
+    - zypper install -y make clang libedit-devel python python2-PyYAML lcov
+  script:
+    - CC=clang make debug check
+
+test:release:
+  stage: test
+  before_script:
+    - zypper install -y make libedit
   script:
     - cd tests
     - make
+    - cd ..
+  dependencies:
+    - binary:release
+
+pages:
+  stage: deploy
+  script:
+    - mkdir public
+    - mv coverage public
+  artifacts:
+    paths:
+      - public
+  only:
+    - master
+  dependencies:
+    - test:debug