add .gitlab-ci.yml
authorJean Privat <jean@pryen.org>
Mon, 18 Feb 2019 15:06:21 +0000 (10:06 -0500)
committerJean Privat <jean@pryen.org>
Mon, 18 Feb 2019 15:06:21 +0000 (10:06 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

.gitlab-ci.yml [new file with mode: 0644]

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..1a70ece
--- /dev/null
@@ -0,0 +1,333 @@
+image: nitlang/nit-ci
+
+cache:
+  paths:
+    - .ccache
+  key: "$CI_JOB_NAME"
+
+stages:
+  - build
+  - test
+  - more_test
+  - deploy
+
+before_script:
+  - date
+  - export CCACHE_DIR=$PWD/.ccache
+  - export PATH=$PWD/bin:$PATH
+  - pwd
+  - ccache -s
+  - ccache -M 500M
+  - type -a nitc nitdoc || true # is there some nit tools?
+  - "> status.txt"
+
+after_script:
+  - export CCACHE_DIR=$PWD/.ccache
+  - ccache -s
+  - git status --ignored
+  - date
+  - tail status.txt
+
+# BASIC JOBS ########################################################
+
+sanity_checks:
+  stage: build
+  script:
+    - misc/jenkins/checkwhitespaces.sh | tee -a status.txt
+    - misc/jenkins/checksignedoffby.sh | tee -a status.txt
+    - misc/jenkins/checklicense.sh | tee -a status.txt
+
+build_tools:
+  stage: build
+  script:
+    - make 2>> status.txt
+    - nitc --version
+    - misc/jenkins/check_manpages.sh
+    - "{ cd tests && ./tests.sh base_sim*.nit ../src/nitlight.nit; }"
+    - nitunit -v lib/core
+  artifacts:
+    paths:
+      - bin/*
+      - c_src/nitc
+      - src/version.nit
+      - src/nitc_0
+      - nitunit.xml*
+      - tests/*.xml*
+    when: always
+    reports:
+      junit:
+        - tests/*.xml
+        - nitunit.xml
+
+test_some:
+  stage: test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./search_tests_git.sh origin/master HEAD > list
+    - ./testall.sh `cat list` | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml
+    when: always
+    reports:
+      junit: tests/*.xml
+
+nitunit_some:
+  stage: test
+  dependencies:
+    - build_tools
+  script:
+    - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/" > list0.txt
+    - xargs nitls -pP < list0.txt > list.txt
+    - xargs nitunit < list.txt
+  artifacts:
+    paths:
+      - nitunit.xml*
+    when: always
+    reports:
+      junit:
+        - nitunit.xml
+
+nitpick_full:
+  stage: test
+  dependencies:
+    - build_tools
+  script:
+    - nitls lib src examples contrib
+    - nitls -Pp lib src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+    - xargs nitpick < list.txt
+
+# TEST FULL #########################################################
+
+test_full_nitcs:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+test_full_niti:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh --engine niti | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+test_full_nitcg:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh --engine nitcg | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+test_full_nitce:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh --engine nitce | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+test_full_nitcsg:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd tests
+    - ./testfull.sh --engine nitcsg | tee log.txt
+    - grep -v '=>' log.txt > ../status.txt || true
+  artifacts:
+    paths:
+      - tests/errlist
+      - tests/*.xml*
+      - tests/out/*.res
+      - tests/out/*.log
+    when: always
+    reports:
+      junit: tests/*.xml
+
+# LIB, CONTRIB AND OOT ##############################################
+
+nitunit_lib:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - nitls -Pp lib | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+    - xargs nitunit -v < list.txt| tee log.txt
+    - grep -e KO log.txt > status.txt || true
+    - tail -3 log.txt >> status.txt
+  artifacts:
+    paths:
+      - nitunit.xml*
+    when: always
+    reports:
+      junit:
+        - nitunit.xml
+
+nitunit_src:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - nitls -Pp src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
+    - xargs nitunit -v < list.txt| tee log.txt
+    - grep -e KO log.txt > status.txt || true
+    - tail -3 log.txt >> status.txt
+  artifacts:
+    paths:
+      - nitunit.xml*
+    when: always
+    reports:
+      junit:
+        - nitunit.xml
+
+test_contribs:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - misc/jenkins/check_contrib.sh all check
+    - grep 'error message' *.xml > status.txt || true
+    - test ! -s status.txt # no lines, no errors
+  allow_failure: true
+
+build_oot:
+  stage: more_test
+  dependencies:
+    - build_more_tools
+  script:
+    - cd contrib
+    - ./oot.sh all
+    - grep 'error message' *.xml > ../status.txt || true
+    - test ! -s ../status.txt # no lines, no errors
+  allow_failure: true
+
+# MISC ##############################################################
+
+bootstrap_full:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd src
+    - ./full_bootstrap
+    - ./ncall.sh
+
+bench_fast:
+  stage: more_test
+  dependencies:
+    - build_tools
+  script:
+    - cd benchmarks
+    - ./bench_engines.sh --fast --fast --html options
+    - grep -B1 'error message' *.xml | grep testcase > ../status.txt || true
+  artifacts:
+    paths:
+      - benchmarks/*.html
+      - benchmarks/*.png
+      - benchmarks/*.dat
+      - benchmarks/*.gnu
+    when: always
+  allow_failure: true
+
+
+# MORE TOOLS ########################################################
+
+build_more_tools:
+  stage: test
+  dependencies:
+    - build_tools
+  script:
+    - make more
+    - make -C "contrib/nitcc"
+  artifacts:
+    paths:
+      - bin/*
+      - c_src/nitc
+      - src/version.nit
+      - src/nitc_0
+
+build_doc:
+  stage: more_test
+  dependencies:
+    - build_more_tools
+  script:
+    - nitls -r -t .
+    - nitdoc -d nitdoc.out --keep-going lib src
+  artifacts:
+    paths:
+      - nitdoc.out
+
+build_catalog:
+  stage: more_test
+  dependencies:
+    - build_more_tools
+  script:
+    - misc/jenkins/check_contrib.sh pre-build
+    - cd contrib
+    - ./oot.sh update
+    - ./oot.sh pre-build
+    - cd ..
+    - nitcatalog -d catalog.out lib/ examples/ contrib/ contrib/oot/
+  dependencies:
+    - build_more_tools
+  artifacts:
+    paths:
+      - catalog.out
+
+.test_macos:
+  script:
+    - uname
+    - pwd
+    - ls /
+  stage: build
+  tags:
+    - macos