Skip to content

Commit

Permalink
Merge pull request #641 from metacpan/oalders/faster-travis
Browse files Browse the repository at this point in the history
Try to speed up Travis build times.
  • Loading branch information
mickeyn committed May 13, 2017
2 parents cf613ae + 82cdc16 commit d906e5a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
33 changes: 20 additions & 13 deletions .travis.yml
Expand Up @@ -15,9 +15,6 @@ env:
# We use a non-standard port to avoid trashing production
# but travis will have it running on the standard port.
- ES=localhost:9200
# Carton --deployment only works on the same version of perl
# that the snapshot was built from.
- DEPLOYMENT_PERL_VERSION=5.22

# Instantiate Catalyst models using metacpan_server_testing.conf
- METACPAN_SERVER_CONFIG_LOCAL_SUFFIX=testing
Expand All @@ -29,40 +26,50 @@ matrix:
allow_failures:
- env: USE_CPANFILE_SNAPSHOT=false

# libgmp-dev required by Net::OpenID::Consumer
# postgresql-server-dev-all is required by DBD::Pg

addons:
apt:
packages:
- libgmp-dev
- postgresql-server-dev-all

before_install:
- sudo service elasticsearch stop && curl -O -L https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-2.4.3.deb && sudo dpkg -i --force-confnew elasticsearch-2.4.3.deb && sudo service elasticsearch start

# Run update to make libgmp-dev findable (Required by Net::OpenID::Consumer)
# postgresql-server-dev-all is required by DBD::Pg
- sudo apt-get install libgmp-dev postgresql-server-dev-all

- sudo service elasticsearch restart
- pwd

- cpanm -n Devel::Cover::Report::Coveralls
#- cpanm -n Devel::Cover::Report::Coveralls
- cpanm -n Carton
- cpanm -n App::cpm

# Carton refuses to update Safe.pm to the version specified in the cpanfile and the
# version that's core in 5.16 is too old (it fails to work with Devel::Cover).
- cpanm -n Safe@2.35

install:
- 'carton install `test "${TRAVIS_PERL_VERSION}" = "${DEPLOYMENT_PERL_VERSION}" && test "${USE_CPANFILE_SNAPSHOT}" = "true" && echo " --deployment"`'
- 'cpm install `test "${USE_CPANFILE_SNAPSHOT}" = "false" && echo " --resolver metadb" || echo " --resolver snapshot"`'

before_script:
- "perl -i -pe 's/(servers :)9900/localhost:9200/' metacpan_server_testing.conf"

script:
# Devel::Cover isn't in the cpanfile
# but if it's installed into the global dirs this should work.
# NOTE: No '-r' for prove; 't/fakecpan.t' does the recursion for us.
- HARNESS_PERL_SWITCHES=-MDevel::Cover=+ignore,local carton exec prove -It/lib -lvr t
#- HARNESS_PERL_SWITCHES=-MDevel::Cover=+ignore,local carton exec prove -It/lib -lr -j 2 t
- carton exec prove -It/lib -lr -j 2 t

after_success:
- cover -report coveralls
# - cover -report coveralls

#after_failure:
# - cat ~/.cpanm/build.log

services:
- elasticsearch

# caching /local should save about 5 minutes in module install time
cache:
directories:
- local
4 changes: 2 additions & 2 deletions cpanfile
Expand Up @@ -174,6 +174,8 @@ requires 'version', '0.9901';
requires 'warnings';

test_requires 'App::Prove';
test_requires 'Code::TidyAll', '>= 0.47';
test_requires 'Code::TidyAll::Plugin::UniqueLines';
test_requires 'CPAN::Faker', '0.010';
test_requires 'Devel::Confess';
test_requires 'Module::Faker', '0.015';
Expand All @@ -194,6 +196,4 @@ test_requires 'Test::Routine', '0.012';
test_requires 'Test::Routine::Util', '0';
test_requires 'Test::Vars';

author_requires 'Code::TidyAll', '>= 0.47';
author_requires 'Code::TidyAll::Plugin::UniqueLines';
author_requires 'Plack::Middleware::Rewrite';
5 changes: 5 additions & 0 deletions t/testrules.yml
@@ -0,0 +1,5 @@
---
seq:
- seq: t/0*.t
- par:
- t/**.t

0 comments on commit d906e5a

Please sign in to comment.