forked from metacpan/metacpan-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
102 lines (83 loc) · 2.81 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
language: perl
perl:
- "5.22"
notifications:
email:
recipients:
on_success: always
on_failure: always
irc: "irc.perl.org#metacpan-infra"
env:
global:
# We use a non-standard port to avoid trashing production
# but travis will have it running on the standard port.
- ES=localhost:9200
- ES_TEST=localhost:9200
# Instantiate Catalyst models using metacpan_server_testing.conf
- METACPAN_SERVER_CONFIG_LOCAL_SUFFIX=testing
- DEVEL_COVER_OPTIONS="-ignore,^local/"
- PERL_CARTON_PATH=$HOME/local
- DOCKER_IMAGE_NAME=metacpan-api
matrix:
- CPAN_RESOLVER=metadb PERL_CARTON_PATH=$HOME/no-snapshot HARNESS_VERBOSE=1
- CPAN_RESOLVER=snapshot BUILD_DOCKER=yes
- CPAN_RESOLVER=snapshot BUILD_DOCKER=yes COVERAGE=1 # separate because slow
matrix:
allow_failures:
- env: CPAN_RESOLVER=metadb PERL_CARTON_PATH=$HOME/no-snapshot HARNESS_VERBOSE=1
- env: CPAN_RESOLVER=snapshot BUILD_DOCKER=yes COVERAGE=1
fast_finish: true
addons:
apt:
packages:
# libgmp-dev required by Net::OpenID::Consumer
- libgmp-dev
# postgresql-server-dev-all is required by DBD::Pg
- postgresql-server-dev-all
before_install:
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
- source ~/travis-perl-helpers/init
- bin/docker-elasticsearch /tmp/metacpan.yml /tmp/es 127.0.0.1:9200
- 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 [email protected]
install:
- AUTHOR_TESTING=0 cpm install -L $PERL_CARTON_PATH --resolver $CPAN_RESOLVER --workers $(test-jobs) || (tail -n 500 -f ~/.perl-cpm/build.log; false)
before_script:
- bin/wait-for-open http://$ES_TEST/
- if [ -n "$COVERAGE" ] && [ "$COVERAGE" != 0 ]; then AUTHOR_TESTING=0 cpm install -L $PERL_CARTON_PATH --workers $(test-jobs) Devel::Cover; fi
- AUTHOR_TESTING=0 cpm install -L $PERL_CARTON_PATH --resolver $CPAN_RESOLVER --workers $(test-jobs) || (tail -n 500 -f ~/.perl-cpm/build.log; false)
- cpan-install --coverage # puts Devel::Cover in normal Perl libs so next works
- coverage-setup
script:
- carton exec prove -lr -j$(test-jobs) t
after_success:
- coverage-report
#after_failure:
# - cat ~/.cpanm/build.log
services:
- docker
## Build and push a docker image in production
deploy:
- provider: script
script:
- deploy/build.sh
on:
branch: master
condition: $BUILD_DOCKER = 'yes'
- provider: script
script:
- deploy/push.sh
on:
branch: master
condition: $BUILD_DOCKER = 'yes'
# caching /local should save about 5 minutes in module install time
cache:
directories:
- $HOME/local
- local
- ~/perl5
- t/var/darkpan