aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 75517087668d6104463ac5cd53639e00ec6318ae (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
build:bht:
  stage: build
  image: registry.gitlab.ost.ch:45023/teachos/devcontainers/bht.ci:latest
  script:
    - cmake --preset bht
    - cmake --build --preset bht-dbg 2>&1 | tee build_output.txt
    - set -o pipefail
    - python3 scripts/ci/parse_clang_tidy.py build_output.txt > code-quality-bht.json
  artifacts:
    paths:
      - build/bht/
    reports:
      codequality: code-quality-bht.json
    expire_in: 5 min

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
  needs: ["build:bht"]
  script:
    - ctest --preset bht-dbg
    - lcov --quiet --config-file .lcovrc --capture --directory $(pwd) --output-file coverage.info
    - lcov --quiet --list coverage.info
    - genhtml --quiet --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/**/junit.xml

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