prepare v2.2.3
[m6w6/ext-pq] / 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 $gen = include __DIR__ . "/ci/gen-matrix.php";
14 $cur = "8.0";
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 "enable_json" => "yes",
21 ],
22 "next" => [
23 "PHP" => ["8.1", "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 (%s)\"\n", $id, $env["PHP"]);
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 PQ_DSN: "postgres:///runner"
49 runs-on: ubuntu-20.04
50 steps:
51 - uses: actions/checkout@v2
52 with:
53 submodules: true
54 - name: Install
55 run: |
56 sudo apt-get install -y \
57 php-cli \
58 php-pear \
59 libpq-dev \
60 re2c
61 - name: Prepare
62 run: |
63 make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
64 make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
65 - name: Build
66 run: |
67 make -f scripts/ci/Makefile ext PECL=pq
68 - name: Prepare Test
69 run: |
70 sudo systemctl start postgresql
71 sudo -u postgres createuser --login runner
72 sudo -u postgres createdb -O runner runner
73 - name: Test
74 run: |
75 make -f scripts/ci/Makefile test
76 <?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
77 - name: Coverage
78 if: success()
79 run: |
80 cd src/.libs
81 bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
82 <?php endif; ?>
83
84 <?php
85 }