(travis) Make sure everything works even when we are SAD
[dbsrgits/DBIx-Class.git] / maint / travis-ci_scripts / 50_after_success.bash
CommitLineData
b58ecb01 1#!/bin/bash
2
afeb40d2 3# this file is executed in a subshell - set up the common stuff
4source maint/travis-ci_scripts/common.bash
5
01fd95b6 6if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] || [[ "$TRAVIS_PULL_REQUEST" != "false" ]] ; then exit 0 ; fi
b58ecb01 7
bf44bdb9 8# this part needs to run in parallel unconditionally
9export VCPU_USE="$VCPU_AVAILABLE"
baa02fa9 10export HARNESS_OPTIONS="j$VCPU_USE"
bf44bdb9 11
12
13if [[ "$DEVREL_DEPS" == "true" ]] && perl -M5.008003 -e1 &>/dev/null ; then
179566f3 14
15 [[ "$BREAK_CC" == "true" ]] && run_or_err "Unbreaking previously broken ~/bin/cc" "rm $HOME/bin/cc"
16
a32fbb3c 17 # FIXME - Devel::Cover (brought by Test::Strict, but soon needed anyway)
18 # does not test cleanly on 5.8.7 - just get it directly
19 if perl -M5.008007 -e1 &>/dev/null && ! perl -M5.008008 -e1 &>/dev/null; then
20 parallel_installdeps_notest Devel::Cover
21 fi
22
23 # FIXME - workaround for YAML/RT#81120 and L::SRH/RT#107681
24 # We don't actually need these modules, only there because of SQLT (which will be fixed)
25 # does not test cleanly on 5.8.7 - just get them directly
26 if ! perl -M5.008008 -e1 &>/dev/null; then
27 parallel_installdeps_notest YAML Lexical::SealRequireHints
28 fi
29
32871272 30 # FIXME - workaround for RT#117855/RT#117856
31 if [[ -n "$PERL_UNICODE" ]] ; then
32 parallel_installdeps_notest Text::CSV
33 fi
34
a32fbb3c 35 # FIXME Change when Moose goes away
36 installdeps Moose $(perl -Ilib -MDBIx::Class::Optional::Dependencies=-list_missing,dist_dir)
bf44bdb9 37
7b87b77c 38 run_or_err "Attempt to build a dist" "rm -rf inc/ && perl Makefile.PL && make dist"
bf44bdb9 39 tarball_assembled=1
40
41elif [[ "$CLEANTEST" != "true" ]] ; then
b4532c43 42
afb8fc52 43 parallel_installdeps_notest $(perl -Ilib -MDBIx::Class::Optional::Dependencies=-list_missing,dist_dir)
bf44bdb9 44
45 run_or_err "Attempt to build a dist from original checkout" "make dist"
46 tarball_assembled=1
47fi
48
49
50if [[ -n "$tarball_assembled" ]] ; then
51
7343c211 52 echo "Contents of the resulting dist tarball:"
53 echo "==========================================="
6a0cbc58 54 tar -vzxf DBIx-Class-*.tar.gz
7343c211 55 echo "==========================================="
bf44bdb9 56
57 # kill as much as possible with fire
58 purge_sitelib
59
baa02fa9 60
61 # undo some of the pollution (if any) affecting the plain install deps
62 # FIXME - this will go away once we move off Moose, and a new SQLT
63 # with much less recommends ships
64 export DBICTEST_SQLT_DEPLOY=""
65 export DBICTEST_VIA_REPLICATED=""
66
67
bf44bdb9 68 # make sure we are retrying with newest CPAN possible
69 #
70 # not running tests on CPAN.pm - they are not terribly slow,
71 # but https://rt.cpan.org/Ticket/Display.html?id=96437 sucks
72 parallel_installdeps_notest CPAN
73 run_or_err "Make sure CPAN was upgraded to at least 2.10" "perl -M'CPAN 2.010' -e1"
74
75 run_or_err "Re-Configuring CPAN.pm" "perl -MCPAN -e '\
76 CPAN::Config->load;
77
78 # For the time being smoking with this setting is not realistic
79 # https://rt.cpan.org/Ticket/Display.html?id=103280
80 # https://rt.cpan.org/Ticket/Display.html?id=37641
81 # https://rt.cpan.org/Ticket/Display.html?id=77708
82 # https://rt.cpan.org/Ticket/Display.html?id=87474
83 #\$CPAN::Config->{build_requires_install_policy} = q{no};
84
85 \$CPAN::Config->{recommends_policy} = q{yes};
86 CPAN::Config->commit;
87 '"
88
89 cd "$(find DBIx-Class-* -maxdepth 0 -type d | head -n 1)"
90
baa02fa9 91 # only run a full test cycle on devrel_deps, as they are all marked
92 # as "allow fails" in the travis matrix
bf44bdb9 93 if [[ "$DEVREL_DEPS" == "true" ]] ; then
94
95 for e in $( env | grep 'DBICTEST.*DSN' | cut -f 1 -d '=' ) ; do
96 echo "Unsetting $e"
97 export $e=""
98 done
99
bf3802a9 100 # FIXME - for some reason a plain `cpan .` does not work in this case
101 # no time to investigate
bf44bdb9 102 run_or_err \
103 "Attempt to configure/test/build/install dist using latest CPAN@$(perl -MCPAN -e 'print CPAN->VERSION')" \
bf3802a9 104 "perl -MCPAN -e 'install( q{.} )'"
bf44bdb9 105
106 else
107 run_or_err \
108 "Attempt to configure/build/install dist using latest CPAN@$(perl -MCPAN -e 'print CPAN->VERSION')" \
109 "perl -MCPAN -e 'notest( install => q{.} )'"
110 fi
344f1f52 111fi