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