gh-actions: ci: we need the pecl-ci submodule
[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 steps:
65 - uses: actions/checkout@v2
66 submodules: true
67 - name: Install
68 run: |
69 sudo apt-get install -y \
70 php-cli \
71 php-pear \
72 libcurl4-openssl-dev \
73 libidn11-dev \
74 libidn2-0-dev \
75 libicu-dev \
76 libevent-dev \
77 libbrotli-dev
78 - name: Prepare
79 run: |
80 make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
81 make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
82 - name: Build
83 run: |
84 make -f travis/pecl/Makefile ext PECL=http
85 - name: Test
86 run: |
87 make -f travis/pecl/Makefile test
88 <?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
89 - name: Coverage
90 if: success()
91 run: |
92 cd src/.libs
93 bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
94 <?php endif; ?>
95
96 <?php
97 }