release v4.2.3
[m6w6/ext-http] / scripts / gen_github_workflow_curl-matrix.php
1 #!/usr/bin/env php
2 <?php echo "# generated file; do not edit!\n"; ?>
3
4 name: curl-matrix
5 on:
6 workflow_dispatch:
7 push:
8
9 jobs:
10 <?php
11
12 if ($argc > 1) {
13 $curlver = array_map(fn($v) => strtr($v, ".", "_"), array_unique(array_slice($argv, 1)));
14 } else {
15 $curlver = array_unique(
16 iterator_to_array(
17 (function() {
18 $split = function($sep, $subject, $def = [""]) {
19 return array_filter(array_map("trim", explode($sep, $subject))) + $def;
20 };
21 foreach (file(__DIR__."/curlver.dist") as $line) {
22 $rec = $split(":", $split("#", $line)[0]);
23 if (!empty($rec[1])) foreach ($split(" ", $rec[1], []) as $dist_ver) {
24 yield strtr($dist_ver, ".", "_");
25 }
26 }
27 })()
28 )
29 );
30 }
31
32 rsort($curlver, SORT_NATURAL);
33
34 $gen = include __DIR__ . "/ci/gen-matrix.php";
35 $job = $gen->github([
36 "curl" => [
37 "PHP" => "8.0",
38 "CURL" => $curlver,
39 "enable_debug" => "yes",
40 "enable_iconv" => "yes",
41 "with_http_libcurl_dir" => "/opt",
42 ]]);
43 foreach ($job as $id => $env) {
44 printf(" curl-%s:\n", $env["CURL"]);
45 printf(" name: curl-%s\n", $env["CURL"]);
46 printf(" continue-on-error: true\n");
47 printf(" env:\n");
48 foreach ($env as $key => $val) {
49 printf(" %s: \"%s\"\n", $key, $val);
50 }
51 ?>
52 runs-on: ubuntu-18.04
53 steps:
54 - uses: actions/checkout@v2
55 with:
56 submodules: true
57 path: http
58 - uses: actions/checkout@v2
59 with:
60 repository: curl/curl
61 path: curl
62 <?php if ($env["CURL"] !== "master") : ?>
63 ref: curl-<?=$env["CURL"]?> #
64 <?php endif; ?>
65 - name: Install
66 run: |
67 echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic main' | sudo tee -a /etc/apt/sources.list && \
68 echo 'deb-src http://azure.archive.ubuntu.com/ubuntu bionic-updates main' | sudo tee -a /etc/apt/sources.list && \
69 sudo apt-get update -y && \
70 sudo apt-get build-dep -y libcurl4-openssl-dev && \
71 sudo apt-get install -y \
72 php-cli \
73 php-pear \
74 libidn11-dev \
75 libidn2-0-dev \
76 libicu-dev \
77 libevent-dev \
78 libbrotli-dev \
79 re2c
80 - name: Curl
81 run: |
82 sudo chmod +x /usr/share/libtool/build-aux/ltmain.sh
83 sudo ln -s /usr/share/libtool/build-aux/ltmain.sh /usr/bin/libtool
84 cd curl
85 ./buildconf
86 ./configure --prefix=/opt --disable-dependency-tracking --with-ssl --with-openssl --without-libssh2
87 make -j2
88 make install
89 - name: Prepare
90 run: |
91 cd http
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 cd http
97 make -f scripts/ci/Makefile ext PECL=http
98 - name: Test
99 run: |
100 cd http
101 make -f scripts/ci/Makefile test
102
103 <?php
104 }