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