summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: 2d36019e6b8dde7cea418ad5847e6c31c3159a9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Dependencies are managed in the Dockerfile in the inkscape-ci-docker
# Git repository. Change them there, wait a bit, and then we'll use
# the new ones here in these builds.
image: registry.gitlab.com/inkscape/inkscape-ci-docker/master

before_script:
  # CCache Config
  - mkdir -p ccache
  - export CCACHE_BASEDIR=${PWD}
  - export CCACHE_DIR=${PWD}/ccache

cache:
  paths:
    - ccache/

# Building inkscape
inkscape:
  stage: build
  script:
    - mkdir -p build
    - cd build
    - cmake .. -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug
    - make -j3
    - cd ..
  artifacts:
    expire_in: 1 year
    paths:
      - build/

# This job is a static analysis build by clang.
# It takes MORE THAN 3 HOURS, and depending on worker sometimes 4 hours.
# Make sure the timeout of the build is big enough
clang:
  stage: build
  only: 
    - schedules
  script:
    - apt-get install -y clang-3.8 clang
    - mkdir -p clang-build
    - cd clang-build
    - scan-build cmake .. -DCMAKE_BUILD_TYPE=Debug
    - VERBOSE=1 scan-build -o ../scan make -j2
  artifacts:
    paths:
      - scan/

test:
  stage: test
  script:
    - cd build
    - make test

# uploads the clang scan to user.gitlab.io/inkscape/
pages:
  stage: deploy
  when: manual
  dependencies:
    - clang
  script:
    - if test -e scan; then cp -r scan/* public; fi
  artifacts:
    paths:
      - public
  only:
    - master