gh-actions: reverse dependency of raphf<-http
[m6w6/ext-raphf] / 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 $cur = "8.0";
14 $gen = include __DIR__ . "/ci/gen-matrix.php";
15 $job = $gen->github([
16 "old-matrix" => [
17 "PHP" => ["7.0", "7.1", "7.2", "7.3", "7.4"],
18 "enable_debug" => "yes",
19 "enable_maintainer_zts" => "yes",
20 "PECLs" => "pecl_http:http:3.2.4",
21 ],
22 "master" => [
23 "PHP" => "master",
24 "enable_debug" => "yes",
25 "enable_zts" => "yes",
26 "PECLs" => "m6w6/ext-http:http:master",
27 ],
28 "cur-dbg-zts" => [
29 "PHP" => $cur,
30 "enable_debug",
31 "enable_zts",
32 "PECLs" => "pecl_http:http:4.0.0",
33 ]]);
34 foreach ($job as $id => $env) {
35 printf(" %s:\n", $id);
36 printf(" name: %s\n", $id);
37 if ($env["PHP"] == "master") {
38 printf(" continue-on-error: true\n");
39 }
40 printf(" env:\n");
41 foreach ($env as $key => $val) {
42 printf(" %s: \"%s\"\n", $key, $val);
43 }
44 ?>
45 runs-on: ubuntu-20.04
46 steps:
47 - uses: actions/checkout@v2
48 with:
49 submodules: true
50 - name: Install
51 run: |
52 sudo apt-get install -y \
53 php-cli \
54 php-pear \
55 libcurl4-openssl-dev \
56 re2c
57 - name: Prepare
58 run: |
59 make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
60 - name: Build
61 run: |
62 make -f scripts/ci/Makefile ext PECL=raphf
63 - name: Prepare Test
64 run: |
65 if test -n "$PECLs"; then
66 IFS=$','
67 for pecl in $PECLs; do
68 make -f scripts/ci/Makefile pecl PECL=$pecl
69 done
70 unset IFS
71 fi
72 - name: Test
73 run: |
74 make -f scripts/ci/Makefile test
75 <?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
76 - name: Coverage
77 if: success()
78 run: |
79 cd src/.libs
80 bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
81 <?php endif; ?>
82
83 <?php
84 }