aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
blob: 43a19f913884e3c18208679a518c9ca5f5f7b379 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
image: ghcr.io/siemens/kas/kas:3.2

variables:
  CPU_REQUEST: ""
  DEFAULT_TAG: ""
  # These are needed as the k8s executor doesn't respect the container
  # entrypoint by default
  FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: 0
  FF_KUBERNETES_HONOR_ENTRYPOINT: 1

stages:
  - prep
  - build

# Common job fragment to get a worker ready
.setup:
  tags:
    - $DEFAULT_TAG
  stage: build
  interruptible: true
  variables:
    KAS_WORK_DIR: $CI_PROJECT_DIR/work
    KAS_REPO_REF_DIR: $CI_BUILDS_DIR/persist/repos
    SSTATE_DIR: $CI_BUILDS_DIR/persist/sstate
    DL_DIR: $CI_BUILDS_DIR/persist/downloads
    BB_LOGCONFIG: $CI_PROJECT_DIR/ci/logging.yml
  before_script:
    - echo KAS_WORK_DIR = $KAS_WORK_DIR
    - echo SSTATE_DIR = $SSTATE_DIR
    - echo DL_DIR = $DL_DIR
    - rm -rf $KAS_WORK_DIR
    - mkdir --verbose --parents $KAS_WORK_DIR $KAS_REPO_REF_DIR $SSTATE_DIR $DL_DIR

# Generalised fragment to do a Kas build
.build:
  extends: .setup
  variables:
    KUBERNETES_CPU_REQUEST: $CPU_REQUEST
  script:
    - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME")
    - kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
    - kas build $KASFILES
    - ./ci/check-warnings $KAS_WORK_DIR/build/warnings.log
  artifacts:
    name: "logs"
    when: on_failure
    paths:
      - $CI_PROJECT_DIR/work/build/tmp/work*/**/temp/log.do_*.*

#
# Prep stage, update repositories once
#
update-repos:
  extends: .setup
  stage: prep
  script:
    - flock --verbose --timeout 60 $KAS_REPO_REF_DIR ./ci/update-repos


#
# Bootstrap stage, machine coverage
#

# What percentage of machines in the layer do we build
machine-coverage:
  stage: prep
  interruptible: true
  script:
    - ./ci/check-machine-coverage
  coverage: '/Coverage: \d+/'
  tags:
    - $DEFAULT_TAG

#
# Build stage, the actual build jobs
#

96b-avenger96:
  extends: .build

96b-nitrogen:
  extends: .build

arduino-nano-33-ble:
  extends: .build

intel-x86-64:
  extends: .build

nrf52840dk-nrf52840:
  extends: .build

qemu-cortex-m3/testimage:
  extends: .build

qemu-nios2:
  extends: .build

qemu-x86/testimage:
  extends: .build

stm32mp157c-dk2:
  extends: .build