prepare v4.2.5
[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.2";
15 $job = $gen->github([
16 "next" => [
17 "PHP" => ["master"],
18 "enable_debug" => "yes",
19 "enable_zts" => "yes",
20 "enable_iconv" => "yes",
21 "TEST_PHP_ARGS" => "-d error_reporting=24575" // ignore E_DEPRECATED
22 ],
23 "old" => [
24 "PHP" => ["8.1", "8.0"],
25 "enable_debug" => "yes",
26 "enable_zts" => "yes",
27 "enable_iconv" => "yes",
28 ],
29 "cur-none" => [
30 // everything disabled for current
31 "PHP" => $cur,
32 "with_http_libicu_dir" => "no",
33 "with_http_libidn_dir" => "no",
34 "with_http_libidn2_dir" => "no",
35 "with_http_libcurl_dir" => "no",
36 "with_http_libevent_dir" => "no",
37 "with_http_libbrotli_dir" => "no",
38 ],
39 "cur-dbg-zts" => [
40 // everything enabled for current, switching debug/zts
41 "PHP" => $cur,
42 "enable_debug",
43 "enable_zts",
44 "enable_iconv" => "yes",
45 ],
46 "cur-cov" => [
47 // once everything enabled for current, with coverage
48 "CFLAGS" => "-O0 -g --coverage",
49 "CXXFLAGS" => "-O0 -g --coverage",
50 "PHP" => $cur,
51 "enable_iconv" => "yes",
52 [
53 // mutually exclusive
54 "with_http_libicu_dir",
55 "with_http_libidn_dir",
56 "with_http_libidn2_dir",
57 ],
58 ]]);
59 foreach ($job as $id => $env) {
60 printf(" %s:\n", $id);
61 printf(" name: \"%s (%s)\"\n", $id, $env["PHP"]);
62 if ($env["PHP"] == "master") {
63 printf(" continue-on-error: true\n");
64 }
65 printf(" env:\n");
66 foreach ($env as $key => $val) {
67 printf(" %s: \"%s\"\n", $key, $val);
68 }
69 ?>
70 runs-on: ubuntu-22.04
71 steps:
72 - uses: actions/checkout@v3
73 with:
74 submodules: true
75 - name: Info
76 run: |
77 locale -a && locale
78 - name: Install
79 run: |
80 sudo apt-get install -y \
81 php-cli \
82 php-pear \
83 libcurl4-openssl-dev \
84 libidn-dev \
85 libidn2-0-dev \
86 libicu-dev \
87 libevent-dev \
88 libbrotli-dev \
89 re2c
90 - name: Prepare
91 run: |
92 make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
93 make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
94 - name: Build
95 run: |
96 make -f scripts/ci/Makefile ext PECL=http
97 - name: Test
98 run: |
99 make -f scripts/ci/Makefile test
100 <?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
101 - name: Coverage
102 if: success()
103 run: |
104 cd src/.libs
105 bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
106 <?php endif; ?>
107
108 <?php
109 }