mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-09 16:01:54 -09:00
Currently when a tag is added to the Buildroot git tree, the gitlab-ci
create a pipeline with several hundred of jobs (~750) to build all
defconfigs and execute the Buildroot testsuite.
However, there is only a limited number of gitlab-ci runner (9 runners)
and some jobs reach the timeout limit (24h) while waiting for a runner
[1]. Indeed, the Buildroot project doesn't use the Gitlab's shared
runners.
In addition to the pipeline created when a new tag is added to the
git repository, two pipelines are created each weeks to execute the
Buildroot testsuite (on monday [2]) and build all defconfigs (on
Thursday [3]).
At some point there are too many jobs waiting in gitlab due board
defconfigs builds. Indded a board defconfig requires a lot of time
(~30min) compared to other jobs in order to build a toolchain and a
kernel linux along with a basic rootfs. There is currently 262
defconfigs.
This is even worse when several pipelines are trigged at the same
time (new git tag and scheduled pipeline trigger).
In order to reduce the number of long jobs, don't build board
defconfigs with pipelines trigged on tag, keeping only the runtime
tests and the Qemu's defconfigs.
[1] https://gitlab.com/buildroot.org/buildroot/-/jobs/1758966541
[2] https://gitlab.com/buildroot.org/buildroot/-/pipelines/404035190
[3] https://gitlab.com/buildroot.org/buildroot/-/pipelines/401685550
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Acked-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit 8ea6eead60)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
114 lines
2.9 KiB
Bash
Executable File
114 lines
2.9 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
set -o pipefail
|
|
|
|
main() {
|
|
local template="${1}"
|
|
|
|
preamble "${template}"
|
|
gen_tests
|
|
}
|
|
|
|
preamble() {
|
|
local template="${1}"
|
|
|
|
cat - "${template}" <<-_EOF_
|
|
# This file is generated; do not edit!
|
|
# Builds appear on https://gitlab.com/buildroot.org/buildroot/pipelines
|
|
|
|
image: ${CI_JOB_IMAGE}
|
|
|
|
_EOF_
|
|
}
|
|
|
|
gen_tests() {
|
|
local -a basics defconfigs runtimes
|
|
local do_basics do_defconfigs do_runtime
|
|
local defconfigs_ext cfg tst
|
|
|
|
basics=( DEVELOPERS flake8 package )
|
|
|
|
defconfigs=( $(cd configs; LC_ALL=C ls -1 *_defconfig) )
|
|
|
|
runtimes=( $(./support/testing/run-tests -l 2>&1 \
|
|
| sed -r -e '/^test_run \((.*)\).*/!d; s//\1/' \
|
|
| LC_ALL=C sort)
|
|
)
|
|
|
|
if [ -n "${CI_COMMIT_TAG}" ]; then
|
|
# When a tag is added to the Buildroot git tree, we want
|
|
# to run the runtime tests and only test Qemu defconfigs.
|
|
defconfigs=( $(cd configs; LC_ALL=C ls -1 qemu_*_defconfig) )
|
|
do_basics=true
|
|
do_defconfigs=base
|
|
do_runtime=true
|
|
elif [ "${CI_PIPELINE_SOURCE}" = "trigger" ]; then
|
|
case "${BR_SCHEDULE_JOBS}" in
|
|
(basic)
|
|
do_basics=true
|
|
do_defconfigs=check
|
|
defconfigs_ext=_check
|
|
;;
|
|
(defconfig)
|
|
do_defconfigs=base
|
|
;;
|
|
(runtime)
|
|
do_runtime=true
|
|
;;
|
|
esac
|
|
else
|
|
case "${CI_COMMIT_REF_NAME}" in
|
|
(*-basics)
|
|
do_basics=true
|
|
do_defconfigs=check
|
|
defconfigs_ext=_check
|
|
;;
|
|
(*-defconfigs)
|
|
do_defconfigs=base
|
|
;;
|
|
(*-*_defconfig)
|
|
defconfigs=( "${CI_COMMIT_REF_NAME##*-}" )
|
|
do_defconfigs=base
|
|
;;
|
|
(*-runtime-tests)
|
|
do_runtime=true
|
|
;;
|
|
(*-tests.*)
|
|
runtimes=( $(./support/testing/run-tests -l 2>&1 \
|
|
| sed -r -e '/^test_run \((.*)\).*/!d; s//\1/' \
|
|
| LC_ALL=C sort \
|
|
| grep "^${CI_COMMIT_REF_NAME##*-}")
|
|
)
|
|
do_runtime=true
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
# If nothing else, at least do the basics to generate a valid pipeline
|
|
if [ -z "${do_defconfigs}" \
|
|
-a -z "${do_runtime}" \
|
|
]
|
|
then
|
|
do_basics=true
|
|
fi
|
|
|
|
if ${do_basics:-false}; then
|
|
for tst in "${basics[@]}"; do
|
|
printf 'check-%s: { extends: .check-%s_base }\n' "${tst}" "${tst}"
|
|
done
|
|
fi
|
|
|
|
if [ -n "${do_defconfigs}" ]; then
|
|
for cfg in "${defconfigs[@]}"; do
|
|
printf '%s%s: { extends: .defconfig_%s }\n' \
|
|
"${cfg}" "${defconfigs_ext}" "${do_defconfigs}"
|
|
done
|
|
fi
|
|
|
|
if ${do_runtime:-false}; then
|
|
printf '%s: { extends: .runtime_test_base }\n' "${runtimes[@]}"
|
|
fi
|
|
}
|
|
|
|
main "${@}"
|