travis: codecov
[m6w6/ext-propro] / scripts / gen_travis_yml.php
index 3f0688840e7fcbbd42c45b764bcf826d6e8adf7f..c65f24fc8e45f5a2a1ff078c47bacec5857fb5e0 100755 (executable)
@@ -10,19 +10,43 @@ addons:
    - php-pear
 
 env:
- matrix:
 <?php
-
 $gen = include "./travis/pecl/gen-matrix.php";
+$cur = "7.3";
 $env = $gen([
-       "PHP" => ["7.0", "7.1", "master"],
+       "PHP" => ["7.0", "7.1", "7.2", "master"],
+       "enable_debug" => "yes",
+       "enable_maintainer_zts" => "yes",
+       "enable_json" => "yes",
+], [
+       "PHP" => $cur,
+       "enable_json" => "yes",
        "enable_debug",
-       "enable_maintainer_zts",
+       "enable_maintainer_zts"
+], [
+       "PHP" => $cur,
+       "enable_json" => "yes",
+       "CFLAGS" => "'-O0 -g --coverage'",
+       "CXXFLAGS" => "'-O0 -g --coverage'",
 ]);
-foreach ($env as $e) {
-       printf("  - %s\n", $e);
+
+foreach ($env as $g) {
+       foreach ($g as $e) {
+               printf(" - %s\n", $e);
+       }
 }
+?>
 
+matrix:
+ fast_finish: true
+ allow_failures:
+<?php
+$allow_failures = array_merge( ... array_map(function($a) {
+       return preg_grep('/^PHP=master /', $a);
+}, $env));
+foreach ($allow_failures as $e) {
+       printf("  - env: %s\n", $e);
+}
 ?>
 
 before_script:
@@ -31,3 +55,6 @@ before_script:
 
 script:
  - make -f travis/pecl/Makefile test
+
+after_success:
+ - test -n "$CFLAGS" && cd src/.libs && bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy