697fb050151561382f04d16daefb19780535b11d
[m6w6/ext-pq] / scripts / gen_travis_yml.php
1 #!/usr/bin/env php
2 # autogenerated file; do not edit
3 language: c
4 sudo: false
5
6 addons:
7 postgresql: 10
8 apt:
9 packages:
10 - php-cli
11 - php-pear
12 - valgrind
13
14 cache:
15 directories:
16 - $HOME/cache
17
18 before_cache:
19 - find $HOME/cache -name '*.gcda' -o -name '*.gcno' -delete
20
21 env:
22 global:
23 - PQ_DSN="postgres://postgres@localhost/test"
24 matrix:
25 <?php
26
27 $gen = include "./travis/pecl/gen-matrix.php";
28 $cur = "7.4";
29 $env = $gen([
30 "PHP" => ["7.0", "7.1", "7.2", "7.3"],
31 "enable_debug" => "yes",
32 "enable_maintainer_zts" => "yes",
33 "enable_json" => "yes",
34 ], [
35 "PHP" => ["8.0", "master"],
36 "enable_debug" => "yes",
37 "enable_zts" => "yes",
38 "enable_json" => "yes",
39 ], [
40 "PHP" => $cur,
41 "enable_json" => "no",
42 ], [
43 "PHP" => $cur,
44 "enable_json" => "yes",
45 "enable_debug",
46 "enable_maintainer_zts"
47 ], [
48 "PHP" => $cur,
49 "enable_json" => "yes",
50 "CFLAGS" => "'-O0 -g --coverage'",
51 "CXXFLAGS" => "'-O0 -g --coverage'",
52 ]);
53
54 foreach ($env as $g) {
55 foreach ($g as $e) {
56 printf(" - %s\n", $e);
57 }
58 }
59 ?>
60
61 matrix:
62 fast_finish: true
63 allow_failures:
64 <?php
65 $allow_failures = array_merge( ... array_map(function($a) {
66 return preg_grep('/^PHP=(master) /', $a);
67 }, $env));
68 foreach ($allow_failures as $e) {
69 printf(" - env: %s\n", $e);
70 }
71 ?>
72
73 install:
74 - |
75 if test "$PHP" = master; then \
76 make -f travis/pecl/Makefile reconf; \
77 make -f travis/pecl/Makefile pecl-rm pecl-clean PECL=raphf:raphf:2.0.0; \
78 fi
79 - make -f travis/pecl/Makefile php || make -f travis/pecl/Makefile clean php
80 - make -f travis/pecl/Makefile pecl PECL=raphf:raphf:2.0.0
81
82 before_script:
83 - psql -U postgres -c "CREATE DATABASE test"
84
85 script:
86 - make -f travis/pecl/Makefile ext PECL=pq
87 - make -f travis/pecl/Makefile test
88
89 after_success:
90 - test -n "$CFLAGS" && cd src/.libs && bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy