.gitlab-ci.yml 1.85 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
20
21
22
    - wget -nc -O /build/model_data.tar.xz https://github.com/lowkey42/mirrage/releases/download/v0.2/model_data.tar.xz
    - cd bin/bin
    - tar xf /build/model_data.tar.xz
Florian Oetke's avatar
Florian Oetke committed
23
24
  artifacts:
    paths:
Florian Oetke's avatar
Florian Oetke committed
25
      - build/bin
Florian Oetke's avatar
Florian Oetke committed
26
    expire_in: 1 day
Florian Oetke's avatar
Florian Oetke committed
27
28
29
30
  cache:
    key: "${CI_PIPELINE_ID}-${CI_COMMIT_REF_SLUG}"
    paths:
    - /build
Florian Oetke's avatar
Florian Oetke committed
31
32
33

build_clang:
  stage: build
Florian Oetke's avatar
Florian Oetke committed
34
  script:
Florian Oetke's avatar
Florian Oetke committed
35
36
37
38
    - export CC=clang
    - export CXX=clang++
    - mkdir build
    - cd build
Florian Oetke's avatar
Florian Oetke committed
39
    - mkdir bin
Florian Oetke's avatar
Florian Oetke committed
40
    - rm -rf /build/src
Florian Oetke's avatar
Florian Oetke committed
41
42
    - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../bin -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
    - cmake --build . --target src/install
43
44
45
    - wget -nc -O /build/model_data.tar.xz https://github.com/lowkey42/mirrage/releases/download/v0.2/model_data.tar.xz
    - cd bin/bin
    - tar xf /build/model_data.tar.xz
Florian Oetke's avatar
Florian Oetke committed
46
  artifacts:
Florian Oetke's avatar
Florian Oetke committed
47
    paths:
Florian Oetke's avatar
Florian Oetke committed
48
      - build/bin
Florian Oetke's avatar
Florian Oetke committed
49
    expire_in: 1 week
Florian Oetke's avatar
Florian Oetke committed
50
51
52
53
  cache:
    key: "${CI_PIPELINE_ID}-${CI_COMMIT_REF_SLUG}"
    paths:
    - /build
Florian Oetke's avatar
Florian Oetke committed
54
55
56
57
58
59
60
61

build_scanbuild:
  stage: build
  script: 
    - export CC=clang
    - export CXX=clang++
    - mkdir build
    - cd build
62
    - 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
63
    - 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
64
65
  artifacts:
    paths:
Florian Oetke's avatar
Florian Oetke committed
66
      - /tmp/
Florian Oetke's avatar
Florian Oetke committed
67
    expire_in: 1 week
68
    when: always
Florian Oetke's avatar
Florian Oetke committed
69
70