gh-actions: ignore E_DEPRECATED for master
[m6w6/ext-http] / scripts / gen_github_workflow_ci.php
1 #!/usr/bin/env php
2 <?php echo "# generated file; do not edit!\n"; ?>
3
4 name: ci
5 on:
6 workflow_dispatch:
7 push:
8 pull_request:
9
10 jobs:
11 <?php
12
13 $gen = include __DIR__ . "/ci/gen-matrix.php";
14 $cur = "8.0";
15 $job = $gen->github([
16 "master" => [
17 // most useful for all additional versions except current
18 "PHP" => ["master"],
19 "enable_debug" => "yes",
20 "enable_zts" => "yes",
21 "enable_iconv" => "yes",
22 "TEST_PHP_ARGS" => "-d error_reporting=24575" // ignore E_DEPRECATED
23 ],
24 "cur-none" => [
25 // everything disabled for current
26 "PHP" => $cur,
27 "with_http_libicu_dir" => "no",
28 "with_http_libidn_dir" => "no",
29 "with_http_libidn2_dir" => "no",
30 "with_http_libcurl_dir" => "no",
31 "with_http_libevent_dir" => "no",
32 "with_http_libbrotli_dir" => "no",
33 ],
34 "cur-dbg-zts" => [
35 // everything enabled for current, switching debug/zts
36 "PHP" => $cur,
37 "enable_debug",
38 "enable_zts",
39 "enable_iconv" => "yes",
40 ],
41 "cur-cov" => [
42 // once everything enabled for current, with coverage
43 "CFLAGS" => "-O0 -g --coverage",
44 "CXXFLAGS" => "-O0 -g --coverage",
45 "PHP" => $cur,
46 "enable_iconv" => "yes",
47 [
48 // mutually exclusive
49 "with_http_libicu_dir",
50 "with_http_libidn_dir",
51 "with_http_libidn2_dir",
52 ],
53 ]]);
54 foreach ($job as $id => $env) {
55 printf(" %s:\n", $id);
56 printf(" name: %s\n", $id);
57 if ($env["PHP"] == "master") {
58 printf(" continue-on-error: true\n");
59 }
60 printf(" env:\n");
61 foreach ($env as $key => $val) {
62 printf(" %s: \"%s\"\n", $key, $val);
63 }
64 ?>
65 runs-on: ubuntu-20.04
66 steps:
67 - uses: actions/checkout@v2
68 with:
69 submodules: true
70 - name: Install
71 run: |
72 sudo apt-get install -y \
73 php-cli \
74 php-pear \
75 libcurl4-openssl-dev \
76 libidn11-dev \
77 libidn2-0-dev \
78 libicu-dev \
79 libevent-dev \
80 libbrotli-dev \
81 re2c
82 - name: Prepare
83 run: |
84 make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
85 make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
86 - name: Build
87 run: |
88 make -f scripts/ci/Makefile ext PECL=http
89 - name: Test
90 run: |
91 make -f scripts/ci/Makefile test
92 <?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
93 - name: Coverage
94 if: success()
95 run: |
96 cd src/.libs
97 bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
98 <?php endif; ?>
99
100 <?php
101 }