.gitlab-ci.yml 1.51 KB
Newer Older
Florian Oetke's avatar
Florian Oetke committed
1
2
3
4
image: lowkey42/build-env:latest

stages:
  - build
Florian Oetke's avatar
Florian Oetke committed
5
6
7
8
  
variables:
  GIT_SUBMODULE_STRATEGY: recursive
  
Florian Oetke's avatar
Florian Oetke committed
9
10
build_gcc:
  stage: build
Florian Oetke's avatar
Florian Oetke committed
11
  script:
Florian Oetke's avatar
Florian Oetke committed
12
13
14
15
    - export CC=gcc
    - export CXX=g++
    - mkdir build
    - cd build
Florian Oetke's avatar
Florian Oetke committed
16
    - mkdir bin
Florian Oetke's avatar
Florian Oetke committed
17
    - rm -rf /build/src
Florian Oetke's avatar
Florian Oetke committed
18
19
    - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
    - cmake --build . --target src/install
Florian Oetke's avatar
Florian Oetke committed
20
21
  artifacts:
    paths:
Florian Oetke's avatar
Florian Oetke committed
22
      - build/bin
Florian Oetke's avatar
Florian Oetke committed
23
    expire_in: 1 day
Florian Oetke's avatar
Florian Oetke committed
24
25
26
27
  cache:
    key: "${CI_PIPELINE_ID}-${CI_COMMIT_REF_SLUG}"
    paths:
    - /build
Florian Oetke's avatar
Florian Oetke committed
28
29
30

build_clang:
  stage: build
Florian Oetke's avatar
Florian Oetke committed
31
  script:
Florian Oetke's avatar
Florian Oetke committed
32
33
34
35
    - export CC=clang
    - export CXX=clang++
    - mkdir build
    - cd build
Florian Oetke's avatar
Florian Oetke committed
36
    - mkdir bin
Florian Oetke's avatar
Florian Oetke committed
37
    - rm -rf /build/src
Florian Oetke's avatar
Florian Oetke committed
38
39
    - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
    - cmake --build . --target src/install
Florian Oetke's avatar
Florian Oetke committed
40
  artifacts:
Florian Oetke's avatar
Florian Oetke committed
41
    paths:
Florian Oetke's avatar
Florian Oetke committed
42
      - build/bin
Florian Oetke's avatar
Florian Oetke committed
43
    expire_in: 1 week
Florian Oetke's avatar
Florian Oetke committed
44
45
46
47
  cache:
    key: "${CI_PIPELINE_ID}-${CI_COMMIT_REF_SLUG}"
    paths:
    - /build
Florian Oetke's avatar
Florian Oetke committed
48
49
50
51
52
53
54
55

build_scanbuild:
  stage: build
  script: 
    - export CC=clang
    - export CXX=clang++
    - mkdir build
    - cd build
56
    - scan-build --use-c++=clang++ --use-cc=clang cmake -DMIRRAGE_FORCE_LIBCPP=ON -DMIRRAGE_ENABLE_COTIRE=OFF -G "Unix Makefiles" ..
Florian Oetke's avatar
Florian Oetke committed
57
    - scan-build --use-c++=clang++ --use-cc=clang -enable-checker deadcode.DeadStores -enable-checker security.insecureAPI.UncheckedReturn --status-bugs -v cmake --build . || true
Florian Oetke's avatar
Florian Oetke committed
58
59
  artifacts:
    paths:
Florian Oetke's avatar
Florian Oetke committed
60
      - /tmp/
Florian Oetke's avatar
Florian Oetke committed
61
    expire_in: 1 week
62
    when: on_failure
Florian Oetke's avatar
Florian Oetke committed
63
64