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