019b283be64915cf40a806105faa652ab490b2a6
[awesomized/ext-ion] / 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 release:
8 types: [published]
9 pull_request:
10 paths-ignore:
11 - .dockerignore
12 - .editorconfig
13 - .gitignore
14 - AUTHORS
15 - CONTRIBUTING.md
16 - CREDITS
17 - Dockerfile
18 - 'docs/**'
19 - EXPERIMENTAL
20 - gen_stub.php*.diff
21 - LICENSE
22 - README.md
23 push:
24 paths-ignore:
25 - .dockerignore
26 - .editorconfig
27 - .gitignore
28 - AUTHORS
29 - CONTRIBUTING.md
30 - CREDITS
31 - Dockerfile
32 - 'docs/**'
33 - EXPERIMENTAL
34 - gen_stub.php*.diff
35 - LICENSE
36 - README.md
37
38 jobs:
39 <?php
40 $gen = include __DIR__ . "/ci/gen-matrix.php";
41 $cur = "8.1";
42 $job = $gen->github([
43 "cur" => [
44 "PHP" => $cur,
45 "enable_debug",
46 "enable_zts",
47 ],
48 "cur-cov" => [
49 "CFLAGS" => "-O0 -g --coverage",
50 "CXXFLAGS" => "-O0 -g --coverage",
51 "PHP" => $cur,
52 ]]);
53 foreach ($job as $id => $env) {
54 printf(" %s:\n", $id);
55 printf(" name: \"%s (%s)\"\n", $id, $env["PHP"]);
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 runs-on: ubuntu-20.04
65 steps:
66 - uses: actions/checkout@v2
67 with:
68 submodules: recursive
69 - name: Install
70 run: |
71 sudo apt-get install -y \
72 php-cli \
73 php-pear \
74 re2c
75 - name: Prepare
76 run: |
77 make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
78 - name: Build
79 run: |
80 make -f scripts/ci/Makefile ext PECL=ion || true # no package.xml yet
81 - name: Test
82 run: |
83 make -f scripts/ci/Makefile test
84 <?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
85 - name: Coverage
86 if: success()
87 run: |
88 find . -name '*.gc*'
89 curl -Os https://uploader.codecov.io/latest/linux/codecov
90 chmod +x codecov
91 ./codecov
92 <?php endif; ?>
93
94 <?php
95 }