.gitlab-ci.yml 9.86 KB
Newer Older
Quirin Gylstorff's avatar
Quirin Gylstorff committed
1
2
3
#
# Xenomai Real-Time System
#
Jan Kiszka's avatar
Jan Kiszka committed
4
# Copyright (c) Siemens AG, 2020-2021
Quirin Gylstorff's avatar
Quirin Gylstorff committed
5
6
7
8
9
10
11
12
#
# Authors:
#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
#
# SPDX-License-Identifier: MIT

stages:
  - build
13
  - test
Quirin Gylstorff's avatar
Quirin Gylstorff committed
14
15
16
17
18
19
20
21

default:
  image: debian:buster

variables:
  GIT_STRATEGY: clone
  KDIR: "/tmp/kernel"
  USE_CCACHE: "1"
22
  CCACHE_MAXSIZE: "1G"
Jan Kiszka's avatar
Jan Kiszka committed
23
  IPIPE_MIRROR_URL: "https://source.denx.de/Xenomai"
24
  DOVETAIL_URL: "https://source.denx.de/Xenomai/linux-dovetail.git"
25
  PACKAGES: "gcc-8 u-boot-tools git make bc bison libelf-dev autotools-dev \
Quirin Gylstorff's avatar
Quirin Gylstorff committed
26
             autoconf autogen libtool pkg-config ccache flex libssl-dev"
27
28
29
30
  PACKAGES_arm: "gcc-8-arm-linux-gnueabihf libc6-dev-armhf-cross"
  PACKAGES_arm64: "gcc-8-aarch64-linux-gnu libc6-dev-arm64-cross"
  PACKAGES_powerpc: "gcc-8-powerpc-linux-gnu libc6-dev-powerpc-cross"
  PACKAGES_x86: ""
31
  XENOMAI_IMAGES_BRANCH: "master"
Quirin Gylstorff's avatar
Quirin Gylstorff committed
32
33
34
35
36

.build:
  stage: build
  before_script:
    - apt update
37
38
    - ARCH_PACKAGES="PACKAGES_${ARCH}"
    - apt install -y ${PACKAGES} ${!ARCH_PACKAGES}
Quirin Gylstorff's avatar
Quirin Gylstorff committed
39
    - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800
40
    - REV=$(git ls-remote --tags --head --refs ${PIPELINE_KERNEL} | sed -e "s/.*[[:space:]]refs\/\(tags\|heads\)\///" | grep "${PIPELINE_REV}" | sort -r -n -t - -k 5 -k 6 | head -1)
Jan Kiszka's avatar
Jan Kiszka committed
41
42
    - test -n "${REV}" || REV="${PIPELINE_REV}"
    - git clone --depth 1 --branch ${REV} ${PIPELINE_KERNEL} ${KDIR}
Quirin Gylstorff's avatar
Quirin Gylstorff committed
43
44
    - case "${ARCH}" in
      "arm64")
45
46
47
      export CROSS_COMPILE=aarch64-linux-gnu-;
      export CONFIGURE_OPTS="--host=aarch64-linux-gnu --with-cc=aarch64-linux-gnu-gcc";
      update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-8 800;
Quirin Gylstorff's avatar
Quirin Gylstorff committed
48
49
      ;;
      "arm")
50
51
52
      export CROSS_COMPILE=arm-linux-gnueabihf-;
      export CONFIGURE_OPTS="--host=arm-linux-gnueabihf --with-cc=arm-linux-gnueabihf-gcc";
      update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-8 800;
Quirin Gylstorff's avatar
Quirin Gylstorff committed
53
54
      ;;
      "powerpc")
55
56
57
      export CROSS_COMPILE=powerpc-linux-gnu-;
      export CONFIGURE_OPTS="--host=powerpc-linux-gnu --with-cc=powerpc-linux-gnu-gcc";
      update-alternatives --install /usr/bin/powerpc-linux-gnu-gcc powerpc-linux-gnu-gcc /usr/bin/powerpc-linux-gnu-gcc-8 800;
Quirin Gylstorff's avatar
Quirin Gylstorff committed
58
59
      ;;
      "x86")
60
61
      export CROSS_COMPILE=;
      export CONFIGURE_OPTS="--enable-dlopen-libs --enable-lazy-setsched";
Quirin Gylstorff's avatar
Quirin Gylstorff committed
62
63
      ;;
      esac
64
65
    - ln -s /usr/lib/ccache/${CROSS_COMPILE}gcc-8 /usr/lib/ccache/${CROSS_COMPILE}gcc
    - export PATH=/usr/lib/ccache:$PATH
Quirin Gylstorff's avatar
Quirin Gylstorff committed
66
67
68
    - ${CROSS_COMPILE}gcc --version

  script:
69
    - export CCACHE_DIR=$(pwd)/.ccache
Quirin Gylstorff's avatar
Quirin Gylstorff committed
70
71
72
73
74
75
    - pushd ${KDIR}
    - make -j $(nproc) ${KERNEL_DEFCONFIG}
    # Generic settings
    - ./scripts/config -d DEBUG_INFO
    # I-pipe and Xenomai settings
    - ./scripts/config -e IPIPE
76
    - ./scripts/config -e DOVETAIL
Quirin Gylstorff's avatar
Quirin Gylstorff committed
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
104
105
106
107
108
109
110
111
    - ./scripts/config -e XENOMAI
    - ./scripts/config -e XENO_OPT_SCHED_CLASSES
    - ./scripts/config -e XENO_OPT_SCHED_WEAK
    - ./scripts/config -e XENO_OPT_SCHED_TP
    - ./scripts/config -e XENO_OPT_SCHED_SPORADIC
    - ./scripts/config -e XENO_OPT_SCHED_QUOTA
    - ./scripts/config -e XENO_OPT_SHIRQ
    - ./scripts/config -e XENO_OPT_SCALABLE_SCHED
    - ./scripts/config -e XENO_OPT_DEBUG
    - ./scripts/config -e XENO_OPT_DEBUG_COBALT
    - ./scripts/config -e XENO_OPT_DEBUG_MEMORY
    - ./scripts/config -e XENO_OPT_DEBUG_CONTEXT
    - ./scripts/config -e XENO_OPT_DEBUG_USER
    - ./scripts/config -e XENO_OPT_DEBUG_LEGACY
    - ./scripts/config -e XENO_OPT_DEBUG_TRACE_RELAX
    - ./scripts/config -e XENO_DRIVERS_16550A
    - ./scripts/config -e XENO_DRIVERS_16550A_ANY
    - ./scripts/config -e XENO_DRIVERS_16550A_PCI
    - ./scripts/config -e XENO_DRIVERS_16550A_PCI_MOXA
    - ./scripts/config -e XENO_DRIVERS_IMX_UART
    - ./scripts/config -e XENO_DRIVERS_RTDMTEST
    - ./scripts/config -e XENO_DRIVERS_CAN
    - ./scripts/config -e XENO_DRIVERS_CAN_LOOPBACK
    - ./scripts/config -e XENO_DRIVERS_CAN_VIRT
    - ./scripts/config -e XENO_DRIVERS_CAN_FLEXCAN
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_ISA
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_MEM
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_PEAK_PCI
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_IXXAT_PCI
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_ADV_PCI
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_PLX_PCI
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_EMS_PCI
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_ESD_PCI
    - ./scripts/config -e XENO_DRIVERS_CAN_SJA1000_PEAK_DNG
112
    - ./scripts/config -e XENO_DRIVERS_CAN_PEAK_CANFD
Quirin Gylstorff's avatar
Quirin Gylstorff committed
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
    - ./scripts/config -m XENO_DRIVERS_NET
    - ./scripts/config -e XENO_DRIVERS_RTNET_CHECKED
    - ./scripts/config -e XENO_DRIVERS_NET_ETH_P_ALL
    - ./scripts/config -e XENO_DRIVERS_NET_RTIPV4_NETROUTING
    - ./scripts/config -e XENO_DRIVERS_NET_RTIPV4_ROUTER
    - ./scripts/config -e XENO_DRIVERS_NET_RTIPV4_DEBUG
    - ./scripts/config -m XENO_DRIVERS_NET_RTIPV4_TCP
    - ./scripts/config -e XENO_DRIVERS_NET_RTIPV4_TCP_ERROR_INJECTION
    - ./scripts/config -m XENO_DRIVERS_NET_NOMAC
    - ./scripts/config -e XENO_DRIVERS_NET_RTCFG_DEBUG
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_PCNET32
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_TULIP
    - ./scripts/config -e XENO_DRIVERS_NET_DRV_EEPRO100_DBG
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_E1000E
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_NATSEMI
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_VIA_RHINE
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_IGB
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_R8169
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_SMC91111
    - ./scripts/config -e XENO_DRIVERS_NET_EXP_DRIVERS
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_3C59X
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_E1000_NEW
    - ./scripts/config -m XENO_DRIVERS_NET_DRV_RT2500
    - ./scripts/config -m XENO_DRIVERS_NET_ADDON_RTCAP
    - ./scripts/config -m XENO_DRIVERS_NET_ADDON_PROXY
    - ./scripts/config -e XENO_DRIVERS_NET_ADDON_PROXY_ARP
    - ./scripts/config -e XENO_DRIVERS_ANALOGY
    - ./scripts/config -e XENO_DRIVERS_ANALOGY_DEBUG
    - ./scripts/config -e XENO_DRIVERS_ANALOGY_DEBUG_FTRACE
    - ./scripts/config -e XENO_DRIVERS_ANALOGY_FAKE
    - ./scripts/config -e XENO_DRIVERS_ANALOGY_NI_PCIMIO
    - ./scripts/config -e XENO_DRIVERS_ANALOGY_S526
    - ./scripts/config -e XENO_DRIVERS_RTIPC
    - ./scripts/config -e XENO_DRIVERS_UDD
    - ./scripts/config -e XENO_DRIVERS_GPIO
    - ./scripts/config -e XENO_DRIVERS_GPIO_BCM2835
    - ./scripts/config -e XENO_DRIVERS_GPIO_MXC
    - ./scripts/config -e XENO_DRIVERS_GPIO_SUN8I_H3
    - ./scripts/config -e XENO_DRIVERS_GPIO_ZYNQ7000
    - ./scripts/config -e XENO_DRIVERS_GPIO_XILINX
    - ./scripts/config -e XENO_DRIVERS_GPIO_OMAP
    - ./scripts/config -e XENO_DRIVERS_GPIO_DEBUG
    - ./scripts/config -e XENO_DRIVERS_GPIOPWM
    - ./scripts/config -e XENO_DRIVERS_SPI_BCM2835
    - ./scripts/config -e XENO_DRIVERS_SPI_SUN6I
    - ./scripts/config -e XENO_DRIVERS_SPI_OMAP2_MCSPI_RT
    - ./scripts/config -e XENO_DRIVERS_SPI_DEBUG
    - popd
    - scripts/prepare-kernel.sh --arch=${ARCH} --linux=${KDIR}
    - pushd ${KDIR}
    - make -j $(nproc) olddefconfig
    - make -j $(nproc) all
    - popd
    - scripts/bootstrap
    - ./configure --enable-smp ${CONFIGURE_OPTS}
    - make -j $(nproc)
    - ccache -s
170
171
172
173
  cache:
    key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
    paths:
      - .ccache
Quirin Gylstorff's avatar
Quirin Gylstorff committed
174

175
176
177
178
179
180
181
182
arm-5.10-head:
  extends: .build
  variables:
    ARCH: arm
    PIPELINE_REV: v5.10.y-dovetail-rebase
    PIPELINE_KERNEL: ${DOVETAIL_URL}
    KERNEL_DEFCONFIG: multi_v7_defconfig

183
arm-5.4-release:
Quirin Gylstorff's avatar
Quirin Gylstorff committed
184
185
186
  extends: .build
  variables:
    ARCH: arm
Jan Kiszka's avatar
Jan Kiszka committed
187
188
    PIPELINE_REV: ipipe-core-5.4..*-arm-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-arm.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
189
190
    KERNEL_DEFCONFIG: multi_v7_defconfig

191
arm-4.19-release:
Quirin Gylstorff's avatar
Quirin Gylstorff committed
192
193
194
  extends: .build
  variables:
    ARCH: arm
Jan Kiszka's avatar
Jan Kiszka committed
195
196
    PIPELINE_REV: ipipe-core-4.19..*-arm-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-arm.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
197
198
    KERNEL_DEFCONFIG: multi_v7_defconfig

199
200
201
202
203
204
205
206
arm64-5.10-head:
  extends: .build
  variables:
    ARCH: arm64
    PIPELINE_REV: v5.10.y-dovetail-rebase
    PIPELINE_KERNEL: ${DOVETAIL_URL}
    KERNEL_DEFCONFIG: defconfig

207
arm64-5.4-release:
Quirin Gylstorff's avatar
Quirin Gylstorff committed
208
209
210
  extends: .build
  variables:
    ARCH: arm64
Jan Kiszka's avatar
Jan Kiszka committed
211
212
    PIPELINE_REV: ipipe-core-5.4..*-arm64-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-arm64.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
213
214
    KERNEL_DEFCONFIG: defconfig

215
arm64-4.19-cip-release:
Quirin Gylstorff's avatar
Quirin Gylstorff committed
216
217
218
  extends: .build
  variables:
    ARCH: arm64
219
    PIPELINE_REV: ipipe-core-4.19..*cip.*-arm64-.*
Jan Kiszka's avatar
Jan Kiszka committed
220
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-arm64.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
221
222
    KERNEL_DEFCONFIG: defconfig

223
224
225
226
227
228
229
230
x86-5.10-head:
  extends: .build
  variables:
    ARCH: x86
    PIPELINE_REV: v5.10.y-dovetail-rebase
    PIPELINE_KERNEL: ${DOVETAIL_URL}
    KERNEL_DEFCONFIG: x86_64_defconfig

Jan Kiszka's avatar
Jan Kiszka committed
231
232
233
234
x86-5.4-head:
  extends: .build
  variables:
    ARCH: x86
Jan Kiszka's avatar
Jan Kiszka committed
235
236
    PIPELINE_REV: ipipe-x86-5.4.y
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-x86.git
Jan Kiszka's avatar
Jan Kiszka committed
237
238
    KERNEL_DEFCONFIG: x86_64_defconfig

Quirin Gylstorff's avatar
Quirin Gylstorff committed
239
240
241
242
x86-4.19-cip-head:
  extends: .build
  variables:
    ARCH: x86
Jan Kiszka's avatar
Jan Kiszka committed
243
244
    PIPELINE_REV: ipipe-x86-4.19.y-cip
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-x86.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
245
246
247
248
249
250
    KERNEL_DEFCONFIG: x86_64_defconfig

x86-4.19-cip-release:
  extends: .build
  variables:
    ARCH: x86
Jan Kiszka's avatar
Jan Kiszka committed
251
252
    PIPELINE_REV: ipipe-core-4.19..*cip.*-x86-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-x86.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
253
254
255
256
257
258
    KERNEL_DEFCONFIG: x86_64_defconfig

powerpc-4.19-release:
  extends: .build
  variables:
    ARCH: powerpc
Jan Kiszka's avatar
Jan Kiszka committed
259
260
    PIPELINE_REV: ipipe-core-4.19..*-ppc32-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-ppc32.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
261
    KERNEL_DEFCONFIG: mpc5200_defconfig
262
263
264
265
266
267
268
269
270
271
272

trigger-xenomai-images:
  stage: test
  image: curlimages/curl
  script:
    - curl -X POST -F "token=${XENOMAI_IMAGES_TOKEN}"
           -F "ref=${XENOMAI_IMAGES_BRANCH}"
           -F "variables[ONLY_RUN]=${CI_COMMIT_BRANCH}"
           https://source.denx.de/api/v4/projects/479/trigger/pipeline
  rules:
    - if: '$XENOMAI_IMAGES_TOKEN != "" && ($CI_COMMIT_BRANCH == "next" || $CI_COMMIT_BRANCH =~ /stable\/.*/)'