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