.gitlab-ci.yml 1.44 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
  
variables:
  GIT_SUBMODULE_STRATEGY: recursive
8
9
10
11
12
13
14
15
16
17

.cache-paths-spec: &cache-paths
  - build

.linux-cache-spec: &linux-cache-spec
  cache:
    key: ${CI_COMMIT_REF_SLUG}-${CI_JOB_NAME}
    paths: *cache-paths

.artifact-spec: &artifact-spec
Florian Oetke's avatar
Florian Oetke committed
18
19
  artifacts:
    paths:
20
      - mirrage
Florian Oetke's avatar
Florian Oetke committed
21
    expire_in: 1 day
Florian Oetke's avatar
Florian Oetke committed
22

23
.build-ninja: &build-ninja
Florian Oetke's avatar
Florian Oetke committed
24
  stage: build
Florian Oetke's avatar
Florian Oetke committed
25
  script:
26
    - cmake -E make_directory build
27
    - cd build
28
29
    - cmake -E remove_directory src
    - cmake -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=../../mirrage -DCMAKE_BUILD_TYPE=Release -DMIRRAGE_EXPORT_EXECUTABLE=ON ..
Florian Oetke's avatar
Florian Oetke committed
30
    - cmake --build . --target src/install
Florian Oetke's avatar
Florian Oetke committed
31
    - cmake --build . --target test
Florian Oetke's avatar
Florian Oetke committed
32

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
build-gcc:
  variables:
    CC: "gcc"
    CXX: "g++"
  <<: *build-ninja
  <<: *linux-cache-spec
  <<: *artifact-spec

build-clang:
  variables:
    CC: "clang"
    CXX: "clang++"
  <<: *build-ninja
  <<: *linux-cache-spec
  <<: *artifact-spec

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