aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 373b68187000b35c34209c319b384a7aedb8b30f (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
build:bht:
  stage: build
  image: registry.gitlab.ost.ch:45023/teachos/devcontainers/bht.ci:latest
  script:
    - cmake --preset $PRESET
    - cmake --build --preset $PRESET-dbg 2>&1 | tee build_output.txt
    - set -o pipefail
    - python3 scripts/ci/parse_clang_tidy.py build_output.txt > code-quality-$PRESET.json
  artifacts:
    paths:
      - build/$PRESET/
    reports:
      codequality: code-quality-$PRESET.json
    expire_in: 5 min
  parallel:
    matrix:
      - PRESET: ["bht", "bht-tsan"]

build:bootable:
  stage: build
  image: registry.gitlab.ost.ch:45023/teachos/devcontainers/x86-64.ci:latest
  script:
    - cmake --preset $PLATFORM
    - cmake --build --preset $PLATFORM-$TYPE 2>&1 | tee build_output.txt
    - set -o pipefail
    - python3 scripts/ci/parse_clang_tidy.py build_output.txt > code-quality-$PLATFORM-$TYPE.json
    - cp build/${PLATFORM}/bin/**/kernel.{dis,elf,sym,iso} .
  artifacts:
    paths:
      - kernel.dis
      - kernel.elf
      - kernel.sym
      - kernel.iso
    reports:
      codequality: code-quality-$PLATFORM-$TYPE.json
    expire_in: 1 week
  parallel:
    matrix:
      - PLATFORM: ["x86_64"]
        TYPE: ["dbg", "rel"]

test:bht:
  stage: test
  image: registry.gitlab.ost.ch:45023/teachos/devcontainers/bht.ci:latest
  script:
    - ctest --preset bht-dbg --parallel --output-on-failure
    - lcov --quiet --config-file .lcovrc --capture --directory $(pwd) --output-file coverage.info
    - lcov --quiet --config-file .lcovrc --list coverage.info
    - genhtml --quiet --config-file .lcovrc --prefix $(pwd) --output-directory coverage coverage.info
    - gcovr --root . --cobertura-pretty --output coverage/cobertura-coverage.xml
  after_script:
    - echo "CoverageReport public URL - https://teachos.pages.ost.ch/-/kernel/-/jobs/$CI_JOB_ID/artifacts/coverage/index.html"
  coverage: '/Total:\|\s*(\d+(?:\.\d+)?)\%/'
  artifacts:
    paths:
      - coverage/
    expire_in: 24 hours
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage/cobertura-coverage.xml
      junit: build/bht-dbg/**/bht_results/*.xml
  needs:
    - job: build:bht
      parallel:
        matrix:
          - PRESET: ["bht"]

test:bht-tsan:
  stage: test
  image: registry.gitlab.ost.ch:45023/teachos/devcontainers/bht.ci:latest
  script:
    - TSAN_OPTIONS=halt_on_error=1 ctest --preset bht-tsan-dbg --parallel --output-on-failure
  artifacts:
    expire_in: 24 hours
    reports:
      junit: build/bht-tsan-dbg/**/bht_results/*.xml
  needs:
    - job: build:bht
      parallel:
        matrix:
          - PRESET: ["bht-tsan"]

license_check:
  stage: .pre
  image:
    name: docker.io/fsfe/reuse
    entrypoint: [""]
  script: reuse lint