mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
0dbb9808a6
Adds the crosvm-side infrastructure to build and test in kokoro. There is a build script for testing on x86, aarch64 and a separte script for analysis (clippy, fmt). These will run in parallel on Kokoro. To test the scripts locally, a simulate script is provided. Runtime on my workstation: - aarch64: 10m - x86: 2:30m - analysis: 1:40m BUG=b:177951955 TEST=./ci/kokoro/simulate_all Change-Id: I2f666ec768e6c3391a258dc7f0cbd999ad9b2fb1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2654413 Tested-by: Dennis Kempin <denniskempin@google.com> Commit-Queue: Dennis Kempin <denniskempin@google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org>
33 lines
912 B
Bash
Executable file
33 lines
912 B
Bash
Executable file
#!/bin/bash
|
|
# Copyright 2021 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
#
|
|
# Simulates a Kokoro run executing one of the build-*.sh scripts.
|
|
# e.g. ./ci/kokoro/simulate build-aarch64.sh
|
|
|
|
kokoro_root=$(mktemp -d)
|
|
kokoro_src="${kokoro_root}/git/crosvm"
|
|
local_src=$(realpath $(dirname $0)/../../)
|
|
|
|
cleanup() {
|
|
echo "Unmounting ${kokoro_src}"
|
|
umount --lazy "${kokoro_src}" || true
|
|
rm -rf "${kokoro_root}"
|
|
}
|
|
|
|
main() {
|
|
# Bind mount source read-only to kokoro_src.
|
|
echo "Bind-mounting ${local_src} to ${kokoro_src}"
|
|
mkdir -p "${kokoro_src}"
|
|
bindfs "${local_src}" "${kokoro_src}" -p 0000,u=rxD
|
|
|
|
# Run user-provided kokoro build script.
|
|
export KOKORO_ARTIFACTS_DIR="${kokoro_root}"
|
|
echo "Running $1 in ${kokoro_root}"
|
|
bash $(dirname $0)/$1
|
|
echo "$1 returned $?"
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
main "$@"
|