xbps-src: add make_check=ci-skip

This commit is contained in:
Piotr Wójcik 2021-04-20 00:05:49 +02:00 committed by Piotr
parent 6387d40587
commit aa83569fcb
5 changed files with 23 additions and 6 deletions

View File

@ -176,9 +176,8 @@ can be used to perform other operations before configuring the package.
- `check` This optional phase checks the result of the `build` phase by running the testsuite provided by the package. - `check` This optional phase checks the result of the `build` phase by running the testsuite provided by the package.
If the default `do_check` function provided by the build style doesn't do anything, the template should set If the default `do_check` function provided by the build style doesn't do anything, the template should set
`make_check_target` and/or `make_check_args` appropriately or define its own `do_check` function. If tests take too long `make_check_target` and/or `make_check_args` appropriately or define its own `do_check` function. If tests take too long
or can't run in all environments, they should be run only if `XBPS_CHECK_PKGS` is `full`, which means they should either or can't run in all environments, `make_check` should be set to fitting value or
be under a `[ "$XBPS_CHECK_PKGS" = full ]` conditional (especially useful with custom `do_check`) or `make_check=extended` `do_check` should be customized to limit testsuite unless `XBPS_CHECK_PKGS` is `full`.
should be set in the template.
- `install` This phase installs the `package files` into the package destdir `<masterdir>/destdir/<pkgname>-<version>`, - `install` This phase installs the `package files` into the package destdir `<masterdir>/destdir/<pkgname>-<version>`,
via `make install` or any other compatible method. via `make install` or any other compatible method.
@ -606,10 +605,15 @@ patches to the package sources during `do_patch()`. Patches are stored in
- `disable_parallel_build` If set the package won't be built in parallel - `disable_parallel_build` If set the package won't be built in parallel
and `XBPS_MAKEJOBS` has no effect. and `XBPS_MAKEJOBS` has no effect.
- `make_check` Sets the cases in which the `check` phase is run. Can be `yes` (the default) to run if - `make_check` Sets the cases in which the `check` phase is run.
`XBPS_CHECK_PKGS` is set, `extended` to run if `XBPS_CHECK_PKGS` is `full` and `no` to never run.
This option should usually be accompanied by a comment explaining why it was set, especially when This option should usually be accompanied by a comment explaining why it was set, especially when
set to `no`. set to `no`.
Allowed values:
- `yes` (the default) to run if `XBPS_CHECK_PKGS` is set.
- `extended` to run if `XBPS_CHECK_PKGS` is `full`.
- `ci-skip` to run locally if `XBPS_CHECK_PKGS` is set, but not as part of pull request checks.
- `no` to never run.
- `keep_libtool_archives` If enabled the `GNU Libtool` archives won't be removed. By default those - `keep_libtool_archives` If enabled the `GNU Libtool` archives won't be removed. By default those
files are always removed automatically. files are always removed automatically.

View File

@ -5,6 +5,7 @@
[ "$XLINT" ] && exit 0 [ "$XLINT" ] && exit 0
/bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m' /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
/bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m' /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'

View File

@ -43,6 +43,12 @@ if [ "$make_check" = extended -a "$XBPS_CHECK_PKGS" != full ]; then
exit 0 exit 0
fi fi
if [ "$make_check" = ci-skip ] && [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then
msg_warn \
"${pkgname}-${version}_${revision}: skipping here because of make_check=ci-skip. Tests should be run locally.\n"
exit 0
fi
for f in $XBPS_COMMONDIR/environment/check/*.sh; do for f in $XBPS_COMMONDIR/environment/check/*.sh; do
source_file "$f" source_file "$f"
done done

View File

@ -136,6 +136,12 @@ XBPS_SUCMD="sudo /bin/sh -c"
# #
#XBPS_USE_BUILD_MTIME=yes #XBPS_USE_BUILD_MTIME=yes
# [OPTIONAL]
# Enable continuous integration specific mode of operation. Currently this
# disables do_check for some packages.
#
#XBPS_BUILD_ENVIRONMENT=void-packages-ci
# [OPTIONAL] # [OPTIONAL]
# When using the 'ethereal' chroot-style this switch must be activated, it is # When using the 'ethereal' chroot-style this switch must be activated, it is
# meant as safeguard against users casually destroying their systems # meant as safeguard against users casually destroying their systems

View File

@ -635,7 +635,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \ XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \
XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \ XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \
XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \ XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \
XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT
for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
eval val="\$XBPS_$i" eval val="\$XBPS_$i"