.gitlab-ci.yml 1.57 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
    - export CC=gcc
    - export CXX=g++
Florian Oetke's avatar
Florian Oetke committed
14
    - mkdir -p build
15
    - cd build
Florian Oetke's avatar
Florian Oetke committed
16
    - mkdir -p bin
17
    - rm -rf src
18
    - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
Florian Oetke's avatar
Florian Oetke committed
19
    - cmake --build . --target src/install
Florian Oetke's avatar
Florian Oetke committed
20
    - cmake --build . --target test
Florian Oetke's avatar
Florian Oetke committed
21
22
  artifacts:
    paths:
23
      - build/bin
Florian Oetke's avatar
Florian Oetke committed
24
    expire_in: 1 day
25
26
27
28
  cache:
    key: "gcc_${CI_COMMIT_REF_SLUG}"
    paths:
    - build
Florian Oetke's avatar
Florian Oetke committed
29
30
31

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

51
build_scanbuild:
Florian Oetke's avatar
Florian Oetke committed
52
53
54
55
  stage: build
  script: 
    - export CC=clang
    - export CXX=clang++
Florian Oetke's avatar
Florian Oetke committed
56
    - mkdir -p build
Florian Oetke's avatar
Florian Oetke committed
57
    - cd build
58
    - 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
59
    - scan-build -o result --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
60
61
  artifacts:
    paths:
Florian Oetke's avatar
Florian Oetke committed
62
      - build/result
63
    expire_in: 1 week
64
    when: always
Florian Oetke's avatar
Florian Oetke committed
65
66