travis -> gh-actions
[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 if test -n "$PECLs"; then
61 IFS=$','
62 for pecl in $PECLs; do
63 make -f scripts/ci/Makefile pecl PECL=$pecl
64 done
65 unset IFS
66 fi
67
68 - name: Build
69 run: |
70 make -f scripts/ci/Makefile ext PECL=raphf
71 - name: Test
72 run: |
73 make -f scripts/ci/Makefile test
74 <?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
75 - name: Coverage
76 if: success()
77 run: |
78 cd src/.libs
79 bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
80 <?php endif; ?>
81
82 <?php
83 }