.gitlab-ci.yml 1.25 KB
Newer Older
1
image: ubuntu:yakkety
Guenter Schwann's avatar
Guenter Schwann committed
2 3 4 5 6 7 8 9 10

cache:
  key: apt-cache
  paths:
  - apt-cache/
  
before_script: 
  - export APT_CACHE_DIR=`pwd`/apt-cache && mkdir -pv $APT_CACHE_DIR
  - apt-get update -yq
11
  - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y build-essential g++ clang clang-3.9 make
Guenter Schwann's avatar
Guenter Schwann committed
12
  - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y qtbase5-dev-tools qtdeclarative5-dev qt5-default
Guenter Schwann's avatar
Guenter Schwann committed
13
  - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y lcov gcovr
Guenter Schwann's avatar
Guenter Schwann committed
14

Guenter Schwann's avatar
Guenter Schwann committed
15
build_gcc:
Guenter Schwann's avatar
Guenter Schwann committed
16 17
  stage: build
  script: 
Guenter Schwann's avatar
Guenter Schwann committed
18 19
    - mkdir -p build
    - cd build
Guenter Schwann's avatar
Guenter Schwann committed
20
    - qmake CONFIG+=debug CONFIG+=coverage -recursive ..
Guenter Schwann's avatar
Guenter Schwann committed
21 22 23 24
    - make -j 4
  artifacts:
    paths:
      - build
Guenter Schwann's avatar
Guenter Schwann committed
25 26 27 28 29
  # depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
  # cache:
  #   paths:
  #     - "*.o"

Guenter Schwann's avatar
Guenter Schwann committed
30 31 32 33 34 35 36 37
build_clang:
  stage: build
  script: 
    - mkdir -p build_clang
    - cd build_clang
    - qmake QMAKE_CC=clang QMAKE_CXX=clang++ -recursive ..
    - make -j 4

Guenter Schwann's avatar
Guenter Schwann committed
38
# run tests using the binary built before
Guenter Schwann's avatar
Guenter Schwann committed
39 40 41
test:
  stage: test
  script:
Guenter Schwann's avatar
Guenter Schwann committed
42
    - find build | xargs touch # Avoid rebuilding
Guenter Schwann's avatar
Guenter Schwann committed
43
    - cd build
Guenter Schwann's avatar
Guenter Schwann committed
44
    - export LD_LIBRARY_PATH=`pwd`/lib:`pwd`/tests/testObjects:${LD_LIBRARY_PATH}
Guenter Schwann's avatar
Guenter Schwann committed
45
    - echo ${LD_LIBRARY_PATH}
Guenter Schwann's avatar
Guenter Schwann committed
46
    - make coverage-html
Guenter Schwann's avatar
Guenter Schwann committed
47 48
  dependencies:
    - build_gcc