From: Ailin Nemui Date: Fri, 23 Jun 2017 12:35:49 +0000 (+0200) Subject: try building on trusty container X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=258ab779494848ea23a4d01588f5debf7aa16bbf;p=irssi-scripts.irssi.org.git try building on trusty container --- diff --git a/.gitignore b/.gitignore index c08f9ad..a16c005 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -_site \ No newline at end of file +_site +*~ diff --git a/.travis.yml b/.travis.yml index 757414e..a177382 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,44 +1,64 @@ -sudo: required +sudo: false dist: trusty -language: c +language: perl +cache: + directories: + - extlib +perl: +# ~stretch +- "5.24-shrplib" +addons: + apt: + packages: + # irssi build dependencies + - elinks + # script test dependencies + - zsh + # script dependencies + - libdb-dev + - libaspell-dev + - libgirepository1.0-dev + - gobject-introspection + - gir1.2-notify-0.7 # for desktop-notify + - xosd-bin # for osd before_install: -- sudo apt-get update -qq -- sudo apt-get build-dep -qq irssi libperl-prereqscanner-perl libperl-critic-perl - cpanminus -- sudo apt-get install -qq lynx zsh apt-file libtest-most-perl libgetopt-long-descriptive-perl - libwww-perl liblog-log4perl-perl libdatetime-perl libmodule-runtime-perl libparams-classify-perl - libtime-duration-parse-perl curl -- perl -V -- wget -qO- https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm | - perl - --sudo App::cpanminus -# Tree::XPathEngine test is broken :-( -- cpanm --force --sudo --quiet --no-interactive --skip-satisfied Tree::XPathEngine -- cpanm --sudo --quiet --no-interactive --skip-satisfied YAML::Tiny Perl::Critic Perl::PrereqScanner PPIx::XPath +- cpanm --quiet local::lib +- eval "$(perl -Mlocal::lib=$TRAVIS_BUILD_DIR/extlib)" - git clone -q git://github.com/irssi/irssi irssi-head -- pushd irssi-head -- ./autogen.sh --with-perl=module 2>/dev/null | tail -n 17 -- make >/dev/null 2>&1 -- sudo make install >/dev/null -- popd -- sudo apt-get install -qq `perl -MYAML::Tiny=LoadFile -e'print qq{@{LoadFile(+shift)->{additional_system_deps}}}' - _testing/config.yml` +- export PERL_MM_NONINTERACTIVE=1 +install: +- | + pushd irssi-head + ./autogen.sh --prefix=$HOME/irssi_inst --with-perl=module 2>/dev/null | tail -n 17 + make >/dev/null 2>&1 + make install | grep -C3 \\\.libs\\\|bin/irssi + popd - | if [ $TRAVIS_PULL_REQUEST = false ] && [ $USE_ARTEFACTS_CACHE = yes ] && [ $EXTRACT_TEST_ARTEFACTS = yes ]; then env -u REPO_LOGIN_TOKEN ./_testing/travis/load-old-artefacts.zsh fi -- env -u REPO_LOGIN_TOKEN ./_testing/travis/autoinstall-perl-prereqs.zsh -install: -- true +- env -u REPO_LOGIN_TOKEN + cpanm --quiet --installdeps --notest . +- env -u REPO_LOGIN_TOKEN + ./_testing/travis/autoinstall-perl-prereqs.zsh +- | + pushd auto + env -u REPO_LOGIN_TOKEN cpanm --quiet --installdeps --notest . + popd before_script: -- env -u REPO_LOGIN_TOKEN ./_testing/run-test.zsh +- export PATH=$HOME/irssi_inst/bin:$PATH +- env -u REPO_LOGIN_TOKEN + ./_testing/run-test.zsh - | if [ $TRAVIS_PULL_REQUEST != false ]; then git diff --stat $TRAVIS_BRANCH fi script: -- env -u REPO_LOGIN_TOKEN ./_testing/report-test.zsh +- env -u REPO_LOGIN_TOKEN + ./_testing/report-test.zsh after_script: -- env -u REPO_LOGIN_TOKEN ./_testing/travis/show-failures.zsh +- env -u REPO_LOGIN_TOKEN + ./_testing/travis/show-failures.zsh - | if [ $TRAVIS_PULL_REQUEST = false ] && $TRAVIS_SECURE_ENV_VARS; then perl ./_testing/travis/update-scripts-yaml.pl diff --git a/_testing/README.markdown b/_testing/README.markdown index 7e2f8f1..6c06001 100644 --- a/_testing/README.markdown +++ b/_testing/README.markdown @@ -34,8 +34,6 @@ pointers to both authors and reviewers. The following keys are recognised in config.yml: -* additional_system_deps: - list of ubuntu packages to install via - apt-get * cpan: * broken_tests: - modules where to skip tests, that would otherwise hang Travis diff --git a/_testing/config.yml b/_testing/config.yml index 0d4e034..08f3e33 100644 --- a/_testing/config.yml +++ b/_testing/config.yml @@ -15,23 +15,15 @@ scripts_yaml_keys: - modules # explicit - modified -additional_system_deps: - - libconfig-simple-perl - - libyaml-perl - - libcrypt-ssleay-perl - - libclass-inspector-perl - - libsoap-lite-perl - - libipc-run3-perl - - libprobe-perl-perl - - libtest-script-perl - - libtext-glob-perl - - libterm-readline-perl-perl - - gir1.2-notify-0.7 # for desktop-notify - - xosd-bin # osd cpan: broken_tests: - Geo::Weather - Net::Google + broken_modules: + - Xmms + - Xmms::Remote + - spamcalc::SpamCalc + - Net::vICQ # This is a whitelist of scripts who are currently allowed to fail # testing. They should be fixed and then removed from the whitelist. whitelist: @@ -39,6 +31,8 @@ whitelist: - cap_sasl_fail - cap_sasl - dnsspam + - email_privmsgs + - idonkey - irc_chess - ircgallery - irssiq @@ -50,5 +44,6 @@ whitelist: - 'on' - stocks - tvmusor + - vidinfo - xetra - xmmsinfo diff --git a/_testing/report-test.zsh b/_testing/report-test.zsh index 6c05f46..27e6b83 100755 --- a/_testing/report-test.zsh +++ b/_testing/report-test.zsh @@ -5,6 +5,7 @@ local passmark="\e[32m✔\e[0m" local skipmark="\e[33m☡\e[0m" local failed=0 local T= +local Q= if [[ $MARKDOWN_REPORT == 1 ]] { echo '## Irssi Scripts Test Report' @@ -16,11 +17,12 @@ if [[ $MARKDOWN_REPORT == 1 ]] { passmark=✔ skipmark=☡ T="|" + Q="\\" } \ else { echo '============================== TEST REPORT =============================' } -printf "%32s $T LOAD $T HDR $T CRIT $T SCORE $T PASS\n" +printf "%-32s $T LOAD $T HDR $T CRIT $T SCORE $T PASS\n" "$Q" if [[ $MARKDOWN_REPORT == 1 ]] { echo "----: $T :--: $T :-: $T :--: $T ----: $T :---:" } diff --git a/_testing/travis/_get_files_arr.zsh b/_testing/travis/_get_files_arr.zsh index 9fb6324..ba6bc94 100644 --- a/_testing/travis/_get_files_arr.zsh +++ b/_testing/travis/_get_files_arr.zsh @@ -20,19 +20,7 @@ elif [[ $USE_ARTEFACTS_CACHE = yes ]] { cached_run=($cache_allowed) } \ else { - autoload -Uz is-at-least - if { is-at-least 5.0.0 } { - filelist=(${filelist:|cache_allowed}) - } \ - else { - # manually filter the array in zsh4 - local -a scriptfiles - for x ($filelist) { - if [[ $+cache_allowed[(r)$x] -eq 0 ]] { - scriptfiles+=($x) - } - } - filelist=($scriptfiles) - } + # is-at-least 5.0.0 + filelist=(${filelist:|cache_allowed}) } } diff --git a/_testing/travis/autoinstall-perl-prereqs.zsh b/_testing/travis/autoinstall-perl-prereqs.zsh index 752ca04..eb692ea 100755 --- a/_testing/travis/autoinstall-perl-prereqs.zsh +++ b/_testing/travis/autoinstall-perl-prereqs.zsh @@ -1,55 +1,26 @@ #!/bin/zsh +mkdir -p auto + . ./_testing/_get_files_arr.zsh -local -a modlist -modlist=($(scan-perl-prereqs $filelist)) echo -n ... >&2 +scan-perl-prereqs $filelist > auto/cpanfile -# fixing shitty broken apt-file -sudo sed -i -e 's,",,g' `find /etc/apt -type f -name sources.list\*` `find /etc/apt/sources.list.d -type f` -sudo apt-file update - -local -a ubu_pkgs -local -a cpan_mods -for mod ($modlist) { - mod=${mod%\~*} - if [[ $mod != Irssi* && $mod != feature ]] { - echo -n $mod >&2 - if { ! perl -M$mod -E1 2>/dev/null } { - local -a ubu_pkg - ubu_pkg=($(apt-file -l search "/perl5/${mod//:://}.pm")) - if [[ $#ubu_pkg -gt 0 ]] { ubu_pkgs+=($ubu_pkg); echo -n '(u)' >&2 } \ - else { cpan_mods+=($mod) } - } - echo -n ' ' >&2 - } -} -echo >&2 - -if [[ $#ubu_pkgs -gt 0 ]] { sudo apt-get install -qq $ubu_pkgs } - -typeset -A broken_tests typeset -A broken_mods - -broken_tests=($(perl -MYAML::Tiny=LoadFile -e'print "$_ 1 " for @{LoadFile(+shift)->{cpan}{broken_tests}}' _testing/config.yml)) broken_mods=($(perl -MYAML::Tiny=LoadFile -e'print "$_ 1 " for @{LoadFile(+shift)->{cpan}{broken_modules}}' _testing/config.yml)) -echo ... >&2 -for mod ($cpan_mods) { - if { ! perl -M$mod -E1 2>/dev/null } { - local skip_test= - if [[ -n $broken_tests[$mod] ]] { - skip_test=--notest - echo Skipping broken test on $mod - } - if [[ -n $broken_mods[$mod] ]] { - echo SKIPPING AUTOINSTALL OF BROKEN MODULE $mod - } \ - else { - echo Auto-installing $mod - sudo cpanm -q --skip-satisfied $skip_test $mod - } - } -} +typeset -a sed_del_broken +for mod (${(k)broken_mods}) { sed_del_broken+=(-e '/^'"$mod"'$/d') } + +sed -i \ + -e '/^Irssi~/d' \ + -e '/^Irssi::/d' \ + $sed_del_broken \ + -e 's,^,'"'"',g' \ + -e 's,$,'"'"',g' \ + -e 's,^,requires ,g' \ + -e 's,$,;,g' \ + auto/cpanfile + exit 0 diff --git a/cpanfile b/cpanfile new file mode 100644 index 0000000..5a7111b --- /dev/null +++ b/cpanfile @@ -0,0 +1,3 @@ +build_requires 'YAML::Tiny'; +build_requires 'Perl::PrereqScanner'; +build_requires 'Perl::Critic';