Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 1 | variables: |
Tom Rini | d5f27cb | 2021-10-31 13:24:42 -0400 | [diff] [blame] | 2 | windows_vm: windows-2019 |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 3 | ubuntu_vm: ubuntu-18.04 |
Tom Rini | ab1e85b | 2020-05-26 20:39:03 -0400 | [diff] [blame] | 4 | macos_vm: macOS-10.15 |
Tom Rini | 61204c1 | 2021-11-13 18:37:00 -0500 | [diff] [blame] | 5 | ci_runner_image: trini/u-boot-gitlab-ci-runner:focal-20211006-14Nov2021 |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 6 | # Add '-u 0' options for Azure pipelines, otherwise we get "permission |
| 7 | # denied" error when it tries to "useradd -m -u 1001 vsts_azpcontainer", |
| 8 | # since our $(ci_runner_image) user is not root. |
| 9 | container_option: -u 0 |
| 10 | work_dir: /u |
Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 11 | |
Tom Rini | 4c268a6 | 2022-01-11 19:14:28 -0500 | [diff] [blame^] | 12 | stages: |
| 13 | - stage: testsuites |
| 14 | jobs: |
Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 15 | - job: tools_only_windows |
| 16 | displayName: 'Ensure host tools build for Windows' |
| 17 | pool: |
| 18 | vmImage: $(windows_vm) |
Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 19 | steps: |
Bin Meng | 31c3bce | 2020-07-28 02:06:44 -0700 | [diff] [blame] | 20 | - powershell: | |
Bin Meng | bd97b0d | 2021-06-22 07:33:21 +0800 | [diff] [blame] | 21 | (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2021-06-04/msys2-base-x86_64-20210604.sfx.exe", "sfx.exe") |
Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 22 | displayName: 'Install MSYS2' |
| 23 | - script: | |
Bin Meng | 31c3bce | 2020-07-28 02:06:44 -0700 | [diff] [blame] | 24 | sfx.exe -y -o%CD:~0,2%\ |
Bin Meng | 8c65515 | 2020-07-28 02:06:42 -0700 | [diff] [blame] | 25 | %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syyuu" |
Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 26 | displayName: 'Update MSYS2' |
| 27 | - script: | |
Tom Rini | a66021b | 2021-03-26 15:14:14 -0400 | [diff] [blame] | 28 | %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -Sy make gcc bison flex diffutils openssl-devel" |
Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 29 | displayName: 'Install Toolchain' |
| 30 | - script: | |
Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 31 | echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh |
Bin Meng | 8c65515 | 2020-07-28 02:06:42 -0700 | [diff] [blame] | 32 | %CD:~0,2%\msys64\usr\bin\bash -lc "bash build-tools.sh" |
Bin Meng | c7072d1 | 2019-10-27 05:19:48 -0700 | [diff] [blame] | 33 | displayName: 'Build Host Tools' |
| 34 | env: |
| 35 | # Tell MSYS2 we need a POSIX emulation layer |
| 36 | MSYSTEM: MSYS |
| 37 | # Tell MSYS2 not to ‘cd’ our startup directory to HOME |
| 38 | CHERE_INVOKING: yes |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 39 | |
Tom Rini | ab1e85b | 2020-05-26 20:39:03 -0400 | [diff] [blame] | 40 | - job: tools_only_macOS |
| 41 | displayName: 'Ensure host tools build for macOS X' |
| 42 | pool: |
| 43 | vmImage: $(macos_vm) |
| 44 | steps: |
| 45 | - script: brew install make |
| 46 | displayName: Brew install dependencies |
| 47 | - script: | |
| 48 | gmake tools-only_config tools-only NO_SDL=1 \ |
| 49 | HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \ |
| 50 | HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \ |
| 51 | -j$(sysctl -n hw.logicalcpu) |
| 52 | displayName: 'Perform tools-only build' |
| 53 | |
Tom Rini | bdfa376 | 2021-12-14 13:36:41 -0500 | [diff] [blame] | 54 | - job: check_for_migrated_symbols_in_board_header |
| 55 | displayName: 'Check for migrated symbols in board header' |
| 56 | pool: |
| 57 | vmImage: $(ubuntu_vm) |
| 58 | container: |
| 59 | image: $(ci_runner_image) |
| 60 | options: $(container_option) |
| 61 | steps: |
| 62 | - script: | |
| 63 | KSYMLST=`mktemp` |
| 64 | KUSEDLST=`mktemp` |
| 65 | cat `find . -name "Kconfig*"` | \ |
| 66 | sed -n -e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \ |
| 67 | -e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \ |
| 68 | | sort -u > $KSYMLST |
| 69 | for CFG in `find include/configs -name "*.h"`; do |
| 70 | grep '#define[[:blank:]]CONFIG_' $CFG | \ |
| 71 | sed -n 's/#define.\(CONFIG_[A-Za-z0-9_]*\).*/\1/p' | \ |
| 72 | sort -u > ${KUSEDLST} || true |
| 73 | NUM=`comm -12 --total --output-delimiter=, ${KSYMLST} ${KUSEDLST} | \ |
| 74 | cut -d , -f 3` |
| 75 | if [[ $NUM -ne 0 ]]; then |
| 76 | echo "Unmigrated symbols found in $CFG" |
| 77 | exit 1 |
| 78 | fi |
| 79 | done |
| 80 | |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 81 | - job: cppcheck |
| 82 | displayName: 'Static code analysis with cppcheck' |
| 83 | pool: |
| 84 | vmImage: $(ubuntu_vm) |
| 85 | container: |
| 86 | image: $(ci_runner_image) |
| 87 | options: $(container_option) |
| 88 | steps: |
Simon Glass | cd1ccfa | 2020-04-05 14:35:43 -0600 | [diff] [blame] | 89 | - script: cppcheck -j$(nproc) --force --quiet --inline-suppr . |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 90 | |
Heinrich Schuchardt | fbf2bf9 | 2020-02-21 18:24:02 +0100 | [diff] [blame] | 91 | - job: htmldocs |
| 92 | displayName: 'Build HTML documentation' |
| 93 | pool: |
| 94 | vmImage: $(ubuntu_vm) |
| 95 | container: |
| 96 | image: $(ci_runner_image) |
| 97 | options: $(container_option) |
| 98 | steps: |
Heinrich Schuchardt | 846abe4 | 2021-01-25 22:06:25 +0100 | [diff] [blame] | 99 | - script: | |
| 100 | virtualenv -p /usr/bin/python3 /tmp/venvhtml |
| 101 | . /tmp/venvhtml/bin/activate |
| 102 | pip install -r doc/sphinx/requirements.txt |
| 103 | make htmldocs |
Heinrich Schuchardt | fbf2bf9 | 2020-02-21 18:24:02 +0100 | [diff] [blame] | 104 | |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 105 | - job: todo |
| 106 | displayName: 'Search for TODO within source tree' |
| 107 | pool: |
| 108 | vmImage: $(ubuntu_vm) |
| 109 | container: |
| 110 | image: $(ci_runner_image) |
| 111 | options: $(container_option) |
| 112 | steps: |
| 113 | - script: grep -r TODO . |
| 114 | - script: grep -r FIXME . |
| 115 | - script: grep -r HACK . | grep -v HACKKIT |
| 116 | |
| 117 | - job: sloccount |
| 118 | displayName: 'Some statistics about the code base' |
| 119 | pool: |
| 120 | vmImage: $(ubuntu_vm) |
| 121 | container: |
| 122 | image: $(ci_runner_image) |
| 123 | options: $(container_option) |
| 124 | steps: |
| 125 | - script: sloccount . |
| 126 | |
| 127 | - job: maintainers |
| 128 | displayName: 'Ensure all configs have MAINTAINERS entries' |
| 129 | pool: |
| 130 | vmImage: $(ubuntu_vm) |
| 131 | container: |
| 132 | image: $(ci_runner_image) |
| 133 | options: $(container_option) |
| 134 | steps: |
| 135 | - script: | |
| 136 | if [ `./tools/genboardscfg.py -f 2>&1 | wc -l` -ne 0 ]; then exit 1; fi |
| 137 | |
| 138 | - job: tools_only |
| 139 | displayName: 'Ensure host tools build' |
| 140 | pool: |
| 141 | vmImage: $(ubuntu_vm) |
| 142 | container: |
| 143 | image: $(ci_runner_image) |
| 144 | options: $(container_option) |
| 145 | steps: |
| 146 | - script: | |
| 147 | make tools-only_config tools-only -j$(nproc) |
| 148 | |
| 149 | - job: envtools |
| 150 | displayName: 'Ensure env tools build' |
| 151 | pool: |
| 152 | vmImage: $(ubuntu_vm) |
| 153 | container: |
| 154 | image: $(ci_runner_image) |
| 155 | options: $(container_option) |
| 156 | steps: |
| 157 | - script: | |
| 158 | make tools-only_config envtools -j$(nproc) |
| 159 | |
| 160 | - job: utils |
Tom Rini | 0b3e0c4 | 2020-03-11 18:11:15 -0400 | [diff] [blame] | 161 | displayName: 'Run binman, buildman, dtoc, Kconfig and patman testsuites' |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 162 | pool: |
| 163 | vmImage: $(ubuntu_vm) |
| 164 | steps: |
| 165 | - script: | |
| 166 | cat << EOF > build.sh |
| 167 | set -ex |
| 168 | cd ${WORK_DIR} |
| 169 | EOF |
| 170 | cat << "EOF" >> build.sh |
| 171 | git config --global user.name "Azure Pipelines" |
| 172 | git config --global user.email bmeng.cn@gmail.com |
| 173 | export USER=azure |
Tom Rini | 6c88310 | 2020-02-11 12:41:14 -0500 | [diff] [blame] | 174 | virtualenv -p /usr/bin/python3 /tmp/venv |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 175 | . /tmp/venv/bin/activate |
Tom Rini | 70c66dd | 2021-02-26 07:52:29 -0500 | [diff] [blame] | 176 | pip install -r test/py/requirements.txt |
Simon Glass | 9e589c0 | 2020-03-18 09:42:50 -0600 | [diff] [blame] | 177 | export UBOOT_TRAVIS_BUILD_DIR=/tmp/sandbox_spl |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 178 | export PYTHONPATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt |
| 179 | export PATH=${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH} |
Simon Glass | a26d8fe | 2021-03-22 08:22:53 +1300 | [diff] [blame] | 180 | ./tools/buildman/buildman -T0 -o ${UBOOT_TRAVIS_BUILD_DIR} -w --board sandbox_spl |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 181 | ./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test |
| 182 | ./tools/buildman/buildman -t |
| 183 | ./tools/dtoc/dtoc -t |
Simon Glass | 109e84e | 2020-07-05 21:41:55 -0600 | [diff] [blame] | 184 | ./tools/patman/patman test |
Tom Rini | 0b3e0c4 | 2020-03-11 18:11:15 -0400 | [diff] [blame] | 185 | make O=${UBOOT_TRAVIS_BUILD_DIR} testconfig |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 186 | EOF |
| 187 | cat build.sh |
| 188 | # We cannot use "container" like other jobs above, as buildman |
| 189 | # seems to hang forever with pre-configured "container" environment |
| 190 | docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh |
| 191 | |
Pali Rohár | 80ad67b | 2020-05-17 14:38:22 +0200 | [diff] [blame] | 192 | - job: nokia_rx51_test |
| 193 | displayName: 'Run tests for Nokia RX-51 (aka N900)' |
| 194 | pool: |
| 195 | vmImage: $(ubuntu_vm) |
| 196 | container: |
| 197 | image: $(ci_runner_image) |
| 198 | options: $(container_option) |
| 199 | steps: |
| 200 | - script: | |
Tom Rini | cc0a454 | 2021-10-14 22:21:29 -0400 | [diff] [blame] | 201 | export PATH=/opt/gcc-11.1.0-nolibc/arm-linux-gnueabi/bin:$PATH |
Pali Rohár | 80ad67b | 2020-05-17 14:38:22 +0200 | [diff] [blame] | 202 | test/nokia_rx51_test.sh |
| 203 | |
Tom Rini | 4c268a6 | 2022-01-11 19:14:28 -0500 | [diff] [blame^] | 204 | - stage: test_py |
| 205 | jobs: |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 206 | - job: test_py |
| 207 | displayName: 'test.py' |
| 208 | pool: |
| 209 | vmImage: $(ubuntu_vm) |
| 210 | strategy: |
| 211 | matrix: |
| 212 | sandbox: |
| 213 | TEST_PY_BD: "sandbox" |
Tom Rini | 99a1bb3 | 2019-11-06 19:30:47 -0500 | [diff] [blame] | 214 | sandbox_clang: |
| 215 | TEST_PY_BD: "sandbox" |
Tom Rini | 4d4251b | 2021-10-05 13:51:38 -0400 | [diff] [blame] | 216 | OVERRIDE: "-O clang-13" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 217 | sandbox_spl: |
| 218 | TEST_PY_BD: "sandbox_spl" |
Simon Glass | 36a69e1 | 2020-10-25 20:38:36 -0600 | [diff] [blame] | 219 | TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl" |
Simon Glass | 492f0b0 | 2021-03-15 17:25:34 +1300 | [diff] [blame] | 220 | sandbox_noinst: |
| 221 | TEST_PY_BD: "sandbox_noinst" |
| 222 | TEST_PY_TEST_SPEC: "test_ofplatdata or test_handoff or test_spl" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 223 | sandbox_flattree: |
| 224 | TEST_PY_BD: "sandbox_flattree" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 225 | evb_ast2500: |
| 226 | TEST_PY_BD: "evb-ast2500" |
| 227 | TEST_PY_ID: "--id qemu" |
Kristian Amlie | 8f8a299 | 2021-09-07 08:37:51 +0200 | [diff] [blame] | 228 | vexpress_ca9x4: |
| 229 | TEST_PY_BD: "vexpress_ca9x4" |
| 230 | TEST_PY_ID: "--id qemu" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 231 | integratorcp_cm926ejs: |
| 232 | TEST_PY_BD: "integratorcp_cm926ejs" |
| 233 | TEST_PY_ID: "--id qemu" |
| 234 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 235 | qemu_arm: |
| 236 | TEST_PY_BD: "qemu_arm" |
| 237 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 238 | qemu_arm64: |
| 239 | TEST_PY_BD: "qemu_arm64" |
| 240 | TEST_PY_TEST_SPEC: "not sleep" |
Daniel Schwierzeck | 879bc74 | 2020-06-06 22:21:47 +0200 | [diff] [blame] | 241 | qemu_malta: |
| 242 | TEST_PY_BD: "malta" |
| 243 | TEST_PY_ID: "--id qemu" |
| 244 | TEST_PY_TEST_SPEC: "not sleep and not efi" |
| 245 | qemu_maltael: |
| 246 | TEST_PY_BD: "maltael" |
| 247 | TEST_PY_ID: "--id qemu" |
| 248 | TEST_PY_TEST_SPEC: "not sleep and not efi" |
| 249 | qemu_malta64: |
| 250 | TEST_PY_BD: "malta64" |
| 251 | TEST_PY_ID: "--id qemu" |
| 252 | TEST_PY_TEST_SPEC: "not sleep and not efi" |
| 253 | qemu_malta64el: |
| 254 | TEST_PY_BD: "malta64el" |
| 255 | TEST_PY_ID: "--id qemu" |
| 256 | TEST_PY_TEST_SPEC: "not sleep and not efi" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 257 | qemu_ppce500: |
| 258 | TEST_PY_BD: "qemu-ppce500" |
| 259 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | aeb3ea4 | 2020-03-28 07:25:27 -0700 | [diff] [blame] | 260 | qemu_riscv32: |
| 261 | TEST_PY_BD: "qemu-riscv32" |
| 262 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 263 | qemu_riscv64: |
| 264 | TEST_PY_BD: "qemu-riscv64" |
| 265 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | b68d9d6 | 2020-03-28 07:25:29 -0700 | [diff] [blame] | 266 | qemu_riscv32_spl: |
| 267 | TEST_PY_BD: "qemu-riscv32_spl" |
| 268 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | b68d9d6 | 2020-03-28 07:25:29 -0700 | [diff] [blame] | 269 | qemu_riscv64_spl: |
| 270 | TEST_PY_BD: "qemu-riscv64_spl" |
| 271 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 272 | qemu_x86: |
| 273 | TEST_PY_BD: "qemu-x86" |
| 274 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 275 | qemu_x86_64: |
| 276 | TEST_PY_BD: "qemu-x86_64" |
| 277 | TEST_PY_TEST_SPEC: "not sleep" |
Marek Vasut | fc5a9d7 | 2020-09-14 21:55:58 +0200 | [diff] [blame] | 278 | r2dplus_i82557c: |
| 279 | TEST_PY_BD: "r2dplus" |
| 280 | TEST_PY_ID: "--id i82557c_qemu" |
| 281 | r2dplus_pcnet: |
| 282 | TEST_PY_BD: "r2dplus" |
| 283 | TEST_PY_ID: "--id pcnet_qemu" |
| 284 | r2dplus_rtl8139: |
| 285 | TEST_PY_BD: "r2dplus" |
| 286 | TEST_PY_ID: "--id rtl8139_qemu" |
| 287 | r2dplus_tulip: |
| 288 | TEST_PY_BD: "r2dplus" |
| 289 | TEST_PY_ID: "--id tulip_qemu" |
Bin Meng | 0ae4106 | 2021-08-26 23:33:35 +0800 | [diff] [blame] | 290 | sifive_unleashed_sdcard: |
| 291 | TEST_PY_BD: "sifive_unleashed" |
| 292 | TEST_PY_ID: "--id sdcard_qemu" |
| 293 | sifive_unleashed_spi-nor: |
| 294 | TEST_PY_BD: "sifive_unleashed" |
| 295 | TEST_PY_ID: "--id spi-nor_qemu" |
Michal Simek | f8834fd | 2020-02-13 15:03:29 +0100 | [diff] [blame] | 296 | xilinx_zynq_virt: |
| 297 | TEST_PY_BD: "xilinx_zynq_virt" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 298 | TEST_PY_ID: "--id qemu" |
| 299 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 300 | xilinx_versal_virt: |
| 301 | TEST_PY_BD: "xilinx_versal_virt" |
| 302 | TEST_PY_ID: "--id qemu" |
| 303 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 304 | xtfpga: |
| 305 | TEST_PY_BD: "xtfpga" |
| 306 | TEST_PY_ID: "--id qemu" |
| 307 | TEST_PY_TEST_SPEC: "not sleep" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 308 | steps: |
| 309 | - script: | |
| 310 | cat << EOF > test.sh |
| 311 | set -ex |
| 312 | # make environment variables available as tests are running inside a container |
| 313 | export WORK_DIR="${WORK_DIR}" |
| 314 | export TEST_PY_BD="${TEST_PY_BD}" |
| 315 | export TEST_PY_ID="${TEST_PY_ID}" |
| 316 | export TEST_PY_TEST_SPEC="${TEST_PY_TEST_SPEC}" |
Tom Rini | 99a1bb3 | 2019-11-06 19:30:47 -0500 | [diff] [blame] | 317 | export OVERRIDE="${OVERRIDE}" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 318 | EOF |
| 319 | cat << "EOF" >> test.sh |
| 320 | # the below corresponds to .gitlab-ci.yml "before_script" |
| 321 | cd ${WORK_DIR} |
Tom Rini | 2a1df58 | 2021-02-24 17:05:04 -0500 | [diff] [blame] | 322 | git clone --depth=1 https://source.denx.de/u-boot/u-boot-test-hooks /tmp/uboot-test-hooks |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 323 | ln -s travis-ci /tmp/uboot-test-hooks/bin/`hostname` |
| 324 | ln -s travis-ci /tmp/uboot-test-hooks/py/`hostname` |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 325 | grub-mkimage --prefix=\"\" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd |
| 326 | grub-mkimage --prefix=\"\" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd |
Bin Meng | b68d9d6 | 2020-03-28 07:25:29 -0700 | [diff] [blame] | 327 | if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]]; then |
Heinrich Schuchardt | ac1b400 | 2021-04-02 11:42:01 +0200 | [diff] [blame] | 328 | wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ; |
| 329 | export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin; |
Bin Meng | b68d9d6 | 2020-03-28 07:25:29 -0700 | [diff] [blame] | 330 | fi |
Bin Meng | 0ae4106 | 2021-08-26 23:33:35 +0800 | [diff] [blame] | 331 | if [[ "${TEST_PY_BD}" == "qemu-riscv64_spl" ]] || [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then |
Heinrich Schuchardt | ac1b400 | 2021-04-02 11:42:01 +0200 | [diff] [blame] | 332 | wget -O - https://github.com/riscv/opensbi/releases/download/v0.9/opensbi-0.9-rv-bin.tar.xz | tar -C /tmp -xJ; |
| 333 | export OPENSBI=/tmp/opensbi-0.9-rv-bin/share/opensbi/lp64/generic/firmware/fw_dynamic.bin; |
Bin Meng | b68d9d6 | 2020-03-28 07:25:29 -0700 | [diff] [blame] | 334 | fi |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 335 | # the below corresponds to .gitlab-ci.yml "script" |
| 336 | cd ${WORK_DIR} |
Simon Glass | 28d83e7 | 2020-03-18 09:42:55 -0600 | [diff] [blame] | 337 | export UBOOT_TRAVIS_BUILD_DIR=/tmp/${TEST_PY_BD}; |
Simon Glass | 87c8046 | 2020-03-18 09:43:00 -0600 | [diff] [blame] | 338 | tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e --board ${TEST_PY_BD} ${OVERRIDE} |
Heinrich Schuchardt | 0c9fdd0 | 2020-07-14 00:40:19 +0200 | [diff] [blame] | 339 | cp ~/grub_x86.efi ${UBOOT_TRAVIS_BUILD_DIR}/ |
| 340 | cp ~/grub_x64.efi ${UBOOT_TRAVIS_BUILD_DIR}/ |
| 341 | cp /opt/grub/grubriscv64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_riscv64.efi |
Heinrich Schuchardt | 0c9fdd0 | 2020-07-14 00:40:19 +0200 | [diff] [blame] | 342 | cp /opt/grub/grubaa64.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm64.efi |
| 343 | cp /opt/grub/grubarm.efi ${UBOOT_TRAVIS_BUILD_DIR}/grub_arm.efi |
Bin Meng | 0ae4106 | 2021-08-26 23:33:35 +0800 | [diff] [blame] | 344 | # create sdcard / spi-nor images for sifive unleashed using genimage |
| 345 | if [[ "${TEST_PY_BD}" == "sifive_unleashed" ]]; then |
| 346 | mkdir -p root; |
| 347 | cp ${UBOOT_TRAVIS_BUILD_DIR}/spl/u-boot-spl.bin .; |
| 348 | cp ${UBOOT_TRAVIS_BUILD_DIR}/u-boot.itb .; |
| 349 | rm -rf tmp; |
| 350 | genimage --inputpath . --config board/sifive/unleashed/genimage_sdcard.cfg; |
| 351 | cp images/sdcard.img ${UBOOT_TRAVIS_BUILD_DIR}/; |
| 352 | rm -rf tmp; |
| 353 | genimage --inputpath . --config board/sifive/unleashed/genimage_spi-nor.cfg; |
| 354 | cp images/spi-nor.img ${UBOOT_TRAVIS_BUILD_DIR}/; |
| 355 | fi |
Tom Rini | 17e41f2 | 2019-10-31 10:45:03 -0400 | [diff] [blame] | 356 | virtualenv -p /usr/bin/python3 /tmp/venv |
| 357 | . /tmp/venv/bin/activate |
| 358 | pip install -r test/py/requirements.txt |
Tom Rini | 528facb | 2019-11-01 13:59:14 -0400 | [diff] [blame] | 359 | export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH}; |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 360 | export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci; |
Simon Glass | 2600f7e | 2020-03-18 09:42:56 -0600 | [diff] [blame] | 361 | # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not |
Heinrich Schuchardt | 2a3ec0a | 2020-07-10 22:04:40 +0200 | [diff] [blame] | 362 | ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR"; |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 363 | # the below corresponds to .gitlab-ci.yml "after_script" |
Tom Rini | 6d4656b | 2020-02-07 11:45:55 -0500 | [diff] [blame] | 364 | rm -rf /tmp/uboot-test-hooks /tmp/venv |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 365 | EOF |
| 366 | cat test.sh |
| 367 | # make current directory writeable to uboot user inside the container |
| 368 | # as sandbox testing need create files like spi flash images, etc. |
| 369 | # (TODO: clean up this in the future) |
| 370 | chmod 777 . |
Alper Nebi Yasak | c6d25c1 | 2021-06-21 21:51:56 +0300 | [diff] [blame] | 371 | # Filesystem tests need extra docker args to run |
| 372 | set -- |
| 373 | if [[ "${TEST_PY_BD}" == "sandbox" ]]; then |
| 374 | # mount -o loop needs the loop devices |
| 375 | if modprobe loop; then |
| 376 | for d in $(find /dev -maxdepth 1 -name 'loop*'); do |
| 377 | set -- "$@" --device $d:$d |
| 378 | done |
| 379 | fi |
| 380 | # Needed for mount syscall (for guestmount as well) |
| 381 | set -- "$@" --cap-add SYS_ADMIN |
| 382 | # Default apparmor profile denies mounts |
| 383 | set -- "$@" --security-opt apparmor=unconfined |
| 384 | fi |
Alper Nebi Yasak | 6fb91f6 | 2021-06-21 21:51:55 +0300 | [diff] [blame] | 385 | # Some tests using libguestfs-tools need the fuse device to run |
Alper Nebi Yasak | c6d25c1 | 2021-06-21 21:51:56 +0300 | [diff] [blame] | 386 | docker run "$@" --device /dev/fuse:/dev/fuse -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/test.sh |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 387 | |
Tom Rini | 4c268a6 | 2022-01-11 19:14:28 -0500 | [diff] [blame^] | 388 | - stage: world_build |
| 389 | jobs: |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 390 | - job: build_the_world |
| 391 | displayName: 'Build the World' |
| 392 | pool: |
| 393 | vmImage: $(ubuntu_vm) |
| 394 | strategy: |
| 395 | # Use almost the same target division in .travis.yml, only merged |
| 396 | # 4 small build jobs (arc/microblaze/nds32/xtensa) into one. |
| 397 | matrix: |
| 398 | arc_microblaze_nds32_xtensa: |
| 399 | BUILDMAN: "arc microblaze nds32 xtensa" |
| 400 | arm11_arm7_arm920t_arm946es: |
| 401 | BUILDMAN: "arm11 arm7 arm920t arm946es" |
| 402 | arm926ejs: |
Tom Rini | f537645 | 2021-07-08 07:50:08 -0400 | [diff] [blame] | 403 | BUILDMAN: "arm926ejs -x freescale,siemens,at91,kirkwood,omap" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 404 | at91_non_armv7: |
| 405 | BUILDMAN: "at91 -x armv7" |
| 406 | at91_non_arm926ejs: |
| 407 | BUILDMAN: "at91 -x arm926ejs" |
| 408 | boundary_engicam_toradex: |
| 409 | BUILDMAN: "boundary engicam toradex" |
| 410 | arm_bcm: |
| 411 | BUILDMAN: "bcm -x mips" |
| 412 | nxp_arm32: |
Heiko Schocher | 56b9b31 | 2019-11-22 11:17:29 +0100 | [diff] [blame] | 413 | BUILDMAN: "freescale -x powerpc,m68k,aarch64,ls101,ls102,ls104,ls108,ls20,lx216" |
| 414 | nxp_ls101x: |
| 415 | BUILDMAN: "freescale&ls101" |
| 416 | nxp_ls102x: |
| 417 | BUILDMAN: "freescale&ls102" |
| 418 | nxp_ls104x: |
| 419 | BUILDMAN: "freescale&ls104" |
| 420 | nxp_ls108x: |
| 421 | BUILDMAN: "freescale&ls108" |
| 422 | nxp_ls20xx: |
| 423 | BUILDMAN: "freescale&ls20" |
| 424 | nxp_lx216x: |
| 425 | BUILDMAN: "freescale&lx216" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 426 | imx6: |
| 427 | BUILDMAN: "mx6 -x boundary,engicam,freescale,technexion,toradex" |
| 428 | imx: |
| 429 | BUILDMAN: "mx -x mx6,freescale,technexion,toradex" |
Tom Rini | 45b49bc | 2021-07-27 17:01:28 -0400 | [diff] [blame] | 430 | imx8: |
| 431 | BUILDMAN: "imx8" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 432 | keystone2_keystone3: |
| 433 | BUILDMAN: "k2 k3" |
| 434 | samsung_socfpga: |
| 435 | BUILDMAN: "samsung socfpga" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 436 | sun4i: |
| 437 | BUILDMAN: "sun4i" |
| 438 | sun5i: |
| 439 | BUILDMAN: "sun5i" |
| 440 | sun6i: |
| 441 | BUILDMAN: "sun6i" |
| 442 | sun7i: |
| 443 | BUILDMAN: "sun7i" |
| 444 | sun8i_32bit: |
| 445 | BUILDMAN: "sun8i&armv7" |
| 446 | sun8i_64bit: |
| 447 | BUILDMAN: "sun8i&aarch64" |
| 448 | sun9i: |
| 449 | BUILDMAN: "sun9i" |
| 450 | sun50i: |
| 451 | BUILDMAN: "sun50i" |
| 452 | arm_catch_all: |
Tom Rini | f04bde5 | 2021-02-15 10:52:19 -0500 | [diff] [blame] | 453 | BUILDMAN: "arm -x arm11,arm7,arm9,aarch64,at91,bcm,freescale,kirkwood,mvebu,renesas,siemens,tegra,uniphier,mx,samsung,sunxi,am33xx,omap,rk,toradex,socfpga,k2,k3,zynq" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 454 | sandbox_x86: |
| 455 | BUILDMAN: "sandbox x86" |
| 456 | technexion: |
| 457 | BUILDMAN: "technexion" |
| 458 | kirkwood: |
| 459 | BUILDMAN: "kirkwood" |
| 460 | mvebu: |
| 461 | BUILDMAN: "mvebu" |
| 462 | m68k: |
| 463 | BUILDMAN: "m68k" |
| 464 | mips: |
| 465 | BUILDMAN: "mips" |
| 466 | non_fsl_ppc: |
| 467 | BUILDMAN: "powerpc -x freescale" |
| 468 | mpc85xx_freescale: |
Simon Glass | 88b8c4d | 2021-08-01 18:54:42 -0600 | [diff] [blame] | 469 | BUILDMAN: "mpc85xx&freescale -x t208xrdb -x t102* -x p1_p2_rdb_pc -x p1010rdb -x corenet_ds -x bsc91*" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 470 | t208xrdb_corenet_ds: |
| 471 | BUILDMAN: "t208xrdb corenet_ds" |
| 472 | fsl_ppc: |
Simon Glass | 88b8c4d | 2021-08-01 18:54:42 -0600 | [diff] [blame] | 473 | BUILDMAN: "mpc83xx&freescale" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 474 | t102x: |
| 475 | BUILDMAN: "t102*" |
| 476 | p1_p2_rdb_pc: |
| 477 | BUILDMAN: "p1_p2_rdb_pc" |
| 478 | p1010rdb_bsc91: |
| 479 | BUILDMAN: "p1010rdb bsc91" |
| 480 | siemens: |
| 481 | BUILDMAN: "siemens" |
| 482 | tegra: |
| 483 | BUILDMAN: "tegra -x toradex" |
| 484 | am33xx_no_siemens: |
| 485 | BUILDMAN: "am33xx -x siemens" |
| 486 | omap: |
| 487 | BUILDMAN: "omap" |
| 488 | uniphier: |
| 489 | BUILDMAN: "uniphier" |
| 490 | aarch64_catch_all: |
Tom Rini | 45b49bc | 2021-07-27 17:01:28 -0400 | [diff] [blame] | 491 | BUILDMAN: "aarch64 -x bcm,imx8,k3,tegra,ls1,ls2,lx216,mvebu,uniphier,renesas,sunxi,samsung,socfpga,rk,versal,zynq" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 492 | rockchip: |
Tom Rini | e289a16 | 2020-03-09 13:01:57 -0400 | [diff] [blame] | 493 | BUILDMAN: "rk" |
Tom Rini | f04bde5 | 2021-02-15 10:52:19 -0500 | [diff] [blame] | 494 | renesas: |
| 495 | BUILDMAN: "renesas" |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 496 | zynq: |
| 497 | BUILDMAN: "zynq&armv7" |
| 498 | zynqmp_versal: |
| 499 | BUILDMAN: "versal|zynqmp&aarch64" |
| 500 | riscv: |
| 501 | BUILDMAN: "riscv" |
| 502 | steps: |
| 503 | - script: | |
| 504 | cat << EOF > build.sh |
| 505 | set -ex |
| 506 | cd ${WORK_DIR} |
| 507 | # make environment variables available as tests are running inside a container |
| 508 | export BUILDMAN="${BUILDMAN}" |
| 509 | EOF |
| 510 | cat << "EOF" >> build.sh |
| 511 | if [[ "${BUILDMAN}" != "" ]]; then |
| 512 | ret=0; |
Bin Meng | 8ba3d24 | 2021-01-31 16:38:35 +0800 | [diff] [blame] | 513 | tools/buildman/buildman -o /tmp -P -E -W ${BUILDMAN} ${OVERRIDE} || ret=$?; |
Simon Glass | da49935 | 2020-03-18 09:42:57 -0600 | [diff] [blame] | 514 | if [[ $ret -ne 0 ]]; then |
Simon Glass | ad8eaed | 2020-03-18 09:42:53 -0600 | [diff] [blame] | 515 | tools/buildman/buildman -o /tmp -seP ${BUILDMAN}; |
Bin Meng | ddaa6b1 | 2019-10-28 07:25:03 -0700 | [diff] [blame] | 516 | exit $ret; |
| 517 | fi; |
| 518 | fi |
| 519 | EOF |
| 520 | cat build.sh |
| 521 | docker run -v $PWD:$(work_dir) $(ci_runner_image) /bin/bash $(work_dir)/build.sh |