release 1.1.0
[m6w6/ext-json_post] / 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" => ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4"],
18 "enable_debug" => "yes",
19 "enable_maintainer_zts" => "yes",
20 "enable_json" => "yes",
21 ],
22 "master" => [
23 "PHP" => "master",
24 "enable_debug" => "yes",
25 "enable_zts" => "yes",
26 ],
27 "cur-dbg-zts" => [
28 "PHP" => $cur,
29 "enable_debug",
30 "enable_zts",
31 ],
32 "cur-cov" => [
33 "CFLAGS" => "-O0 -g --coverage",
34 "CXXFLAGS" => "-O0 -g --coverage",
35 "PHP" => $cur,
36 ]]);
37 foreach ($job as $id => $env) {
38 printf(" %s:\n", $id);
39 printf(" name: %s\n", $id);
40 if ($env["PHP"] == "master") {
41 printf(" continue-on-error: true\n");
42 }
43 printf(" env:\n");
44 foreach ($env as $key => $val) {
45 printf(" %s: \"%s\"\n", $key, $val);
46 }
47 ?>
48 runs-on: ubuntu-20.04
49 steps:
50 - uses: actions/checkout@v2
51 with:
52 submodules: true
53 - name: Install
54 run: |
55 sudo apt-get install -y \
56 php-cli \
57 php-pear \
58 re2c
59 - name: Prepare
60 run: |
61 make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
62 - name: Build
63 run: |
64 make -f scripts/ci/Makefile ext PECL=json_post
65 - name: Test
66 run: |
67 make -f scripts/ci/Makefile test
68 <?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
69 - name: Coverage
70 if: success()
71 run: |
72 cd .libs
73 bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
74 <?php endif; ?>
75
76 <?php
77 }