.gitlab-ci.yml 8.78 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
13
14
15
16
17
18
19
20
#
# Authors:
#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
#
# SPDX-License-Identifier: MIT

stages:
  - build

default:
  image: debian:buster

variables:
  GIT_STRATEGY: clone
  KDIR: "/tmp/kernel"
  USE_CCACHE: "1"
21
  CCACHE_MAXSIZE: "1G"
Jan Kiszka's avatar
Jan Kiszka committed
22
  IPIPE_MIRROR_URL: "https://source.denx.de/Xenomai"
23
  PACKAGES: "gcc-8 u-boot-tools git make bc bison libelf-dev autotools-dev \
Quirin Gylstorff's avatar
Quirin Gylstorff committed
24
             autoconf autogen libtool pkg-config ccache flex libssl-dev"
25
26
27
28
  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: ""
Quirin Gylstorff's avatar
Quirin Gylstorff committed
29
30
31
32
33

.build:
  stage: build
  before_script:
    - apt update
34
35
    - ARCH_PACKAGES="PACKAGES_${ARCH}"
    - apt install -y ${PACKAGES} ${!ARCH_PACKAGES}
Quirin Gylstorff's avatar
Quirin Gylstorff committed
36
    - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800
37
    - 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
38
39
    - test -n "${REV}" || REV="${PIPELINE_REV}"
    - git clone --depth 1 --branch ${REV} ${PIPELINE_KERNEL} ${KDIR}
Quirin Gylstorff's avatar
Quirin Gylstorff committed
40
41
    - case "${ARCH}" in
      "arm64")
42
43
44
      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
45
46
      ;;
      "arm")
47
48
49
      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
50
51
      ;;
      "powerpc")
52
53
54
      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
55
56
      ;;
      "x86")
57
58
      export CROSS_COMPILE=;
      export CONFIGURE_OPTS="--enable-dlopen-libs --enable-lazy-setsched";
Quirin Gylstorff's avatar
Quirin Gylstorff committed
59
60
      ;;
      esac
61
62
    - 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
63
64
65
    - ${CROSS_COMPILE}gcc --version

  script:
66
    - export CCACHE_DIR=$(pwd)/.ccache
Quirin Gylstorff's avatar
Quirin Gylstorff committed
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
104
105
106
107
    - pushd ${KDIR}
    - make -j $(nproc) ${KERNEL_DEFCONFIG}
    # Generic settings
    - ./scripts/config -d DEBUG_INFO
    # I-pipe and Xenomai settings
    - ./scripts/config -e IPIPE
    - ./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
108
    - ./scripts/config -e XENO_DRIVERS_CAN_PEAK_CANFD
Quirin Gylstorff's avatar
Quirin Gylstorff committed
109
110
111
112
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
    - ./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
166
167
168
169
  cache:
    key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
    paths:
      - .ccache
Quirin Gylstorff's avatar
Quirin Gylstorff committed
170

171
arm-5.4-release:
Quirin Gylstorff's avatar
Quirin Gylstorff committed
172
173
174
  extends: .build
  variables:
    ARCH: arm
Jan Kiszka's avatar
Jan Kiszka committed
175
176
    PIPELINE_REV: ipipe-core-5.4..*-arm-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-arm.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
177
178
    KERNEL_DEFCONFIG: multi_v7_defconfig

179
arm-4.19-release:
Quirin Gylstorff's avatar
Quirin Gylstorff committed
180
181
182
  extends: .build
  variables:
    ARCH: arm
Jan Kiszka's avatar
Jan Kiszka committed
183
184
    PIPELINE_REV: ipipe-core-4.19..*-arm-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-arm.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
185
186
    KERNEL_DEFCONFIG: multi_v7_defconfig

187
arm64-5.4-release:
Quirin Gylstorff's avatar
Quirin Gylstorff committed
188
189
190
  extends: .build
  variables:
    ARCH: arm64
Jan Kiszka's avatar
Jan Kiszka committed
191
192
    PIPELINE_REV: ipipe-core-5.4..*-arm64-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-arm64.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
193
194
    KERNEL_DEFCONFIG: defconfig

195
arm64-4.19-cip-release:
Quirin Gylstorff's avatar
Quirin Gylstorff committed
196
197
198
  extends: .build
  variables:
    ARCH: arm64
199
    PIPELINE_REV: ipipe-core-4.19..*cip.*-arm64-.*
Jan Kiszka's avatar
Jan Kiszka committed
200
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-arm64.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
201
202
    KERNEL_DEFCONFIG: defconfig

Jan Kiszka's avatar
Jan Kiszka committed
203
204
205
206
x86-5.4-head:
  extends: .build
  variables:
    ARCH: x86
Jan Kiszka's avatar
Jan Kiszka committed
207
208
    PIPELINE_REV: ipipe-x86-5.4.y
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-x86.git
Jan Kiszka's avatar
Jan Kiszka committed
209
210
    KERNEL_DEFCONFIG: x86_64_defconfig

Quirin Gylstorff's avatar
Quirin Gylstorff committed
211
212
213
214
x86-4.19-cip-head:
  extends: .build
  variables:
    ARCH: x86
Jan Kiszka's avatar
Jan Kiszka committed
215
216
    PIPELINE_REV: ipipe-x86-4.19.y-cip
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-x86.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
217
218
219
220
221
222
    KERNEL_DEFCONFIG: x86_64_defconfig

x86-4.19-cip-release:
  extends: .build
  variables:
    ARCH: x86
Jan Kiszka's avatar
Jan Kiszka committed
223
224
    PIPELINE_REV: ipipe-core-4.19..*cip.*-x86-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-x86.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
225
226
227
228
229
230
    KERNEL_DEFCONFIG: x86_64_defconfig

powerpc-4.19-release:
  extends: .build
  variables:
    ARCH: powerpc
Jan Kiszka's avatar
Jan Kiszka committed
231
232
    PIPELINE_REV: ipipe-core-4.19..*-ppc32-.*
    PIPELINE_KERNEL: ${IPIPE_MIRROR_URL}/ipipe-ppc32.git
Quirin Gylstorff's avatar
Quirin Gylstorff committed
233
    KERNEL_DEFCONFIG: mpc5200_defconfig