travis -> gh-actions
authorMichael Wallner <mike@php.net>
Fri, 15 Jan 2021 11:01:02 +0000 (12:01 +0100)
committerMichael Wallner <mike@php.net>
Fri, 15 Jan 2021 11:01:02 +0000 (12:01 +0100)
.gitattributes
.github/workflows/ci.yml [new file with mode: 0644]
.gitmodules
.travis.yml [deleted file]
README.md
scripts/ci [new submodule]
scripts/gen_github_workflow_ci.php [new file with mode: 0755]
scripts/gen_travis_yml.php [deleted file]
travis/pecl [deleted submodule]

index 29df74b84ddda6945d34a7c2c9ba34f2d1597124..8b608050fe20c19850b68c6b452c06b37467d493 100644 (file)
@@ -1,4 +1,3 @@
 package.xml            merge=touch
 php_pq.h               merge=touch
-.travis.yml            merge=touch
 *.phar                 binary
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644 (file)
index 0000000..ad63594
--- /dev/null
@@ -0,0 +1,437 @@
+# generated file; do not edit!
+
+name: ci
+on:
+  workflow_dispatch:
+  push:
+  pull_request:
+
+jobs:
+  old-matrix-0:
+    name: old-matrix-0
+    env:
+      PHP: "7.0"
+      enable_debug: "yes"
+      enable_maintainer_zts: "yes"
+      enable_json: "yes"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  old-matrix-1:
+    name: old-matrix-1
+    env:
+      PHP: "7.1"
+      enable_debug: "yes"
+      enable_maintainer_zts: "yes"
+      enable_json: "yes"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  old-matrix-2:
+    name: old-matrix-2
+    env:
+      PHP: "7.2"
+      enable_debug: "yes"
+      enable_maintainer_zts: "yes"
+      enable_json: "yes"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  old-matrix-3:
+    name: old-matrix-3
+    env:
+      PHP: "7.3"
+      enable_debug: "yes"
+      enable_maintainer_zts: "yes"
+      enable_json: "yes"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  old-matrix-4:
+    name: old-matrix-4
+    env:
+      PHP: "7.4"
+      enable_debug: "yes"
+      enable_maintainer_zts: "yes"
+      enable_json: "yes"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  master-0:
+    name: master-0
+    continue-on-error: true
+    env:
+      PHP: "master"
+      enable_debug: "yes"
+      enable_zts: "yes"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  cur-none-0:
+    name: cur-none-0
+    env:
+      PHP: "8.0"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  cur-dbg-zts-0:
+    name: cur-dbg-zts-0
+    env:
+      PHP: "8.0"
+      enable_debug: "yes"
+      enable_zts: "yes"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  cur-dbg-zts-1:
+    name: cur-dbg-zts-1
+    env:
+      PHP: "8.0"
+      enable_debug: "no"
+      enable_zts: "yes"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  cur-dbg-zts-2:
+    name: cur-dbg-zts-2
+    env:
+      PHP: "8.0"
+      enable_debug: "yes"
+      enable_zts: "no"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  cur-dbg-zts-3:
+    name: cur-dbg-zts-3
+    env:
+      PHP: "8.0"
+      enable_debug: "no"
+      enable_zts: "no"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+
+  cur-cov-0:
+    name: cur-cov-0
+    env:
+      CFLAGS: "-O0 -g --coverage"
+      CXXFLAGS: "-O0 -g --coverage"
+      PHP: "8.0"
+      enable_spl: "yes"
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+      - name: Coverage
+        if: success()
+        run: |
+          cd src/.libs
+          bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
+
index e53f88c8d93cfb1c4195f5dd3a14376171acb2b4..72fd52f1e1a07f3d22140bf70a526cdf31e361f9 100644 (file)
@@ -1,4 +1,3 @@
-[submodule "travis-pecl"]
-       path = travis/pecl
-       url = https://github.com/m6w6/travis-pecl.git
-       branch = master
+[submodule "scripts/ci"]
+       path = scripts/ci
+       url = https://github.com/m6w6/pecl-ci.git
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index f8d6312..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-# autogenerated file; do not edit
-language: c
-
-addons:
- postgresql: 10
- apt:
-  packages:
-   - php-cli
-   - php-pear
-   - valgrind
-
-cache:
- directories:
-  - $HOME/cache
-
-before_cache:
- - find $HOME/cache -name '*.gcda' -o -name '*.gcno' -delete
-
-env:
- global:
-  - PQ_DSN="postgres://postgres@localhost/test"
- matrix:
-  - PHP=7.0 enable_debug=yes enable_maintainer_zts=yes enable_json=yes
-  - PHP=7.1 enable_debug=yes enable_maintainer_zts=yes enable_json=yes
-  - PHP=7.2 enable_debug=yes enable_maintainer_zts=yes enable_json=yes
-  - PHP=7.3 enable_debug=yes enable_maintainer_zts=yes enable_json=yes
-  - PHP=7.4 enable_debug=yes enable_maintainer_zts=yes enable_json=yes
-  - PHP=master enable_debug=yes enable_zts=yes enable_json=yes
-  - PHP=8.0 enable_json=no
-  - PHP=8.0 enable_json=yes enable_debug=no enable_zts=no
-  - PHP=8.0 enable_json=yes enable_debug=yes enable_zts=no
-  - PHP=8.0 enable_json=yes enable_debug=no enable_zts=yes
-  - PHP=8.0 enable_json=yes enable_debug=yes enable_zts=yes
-  - PHP=8.0 enable_json=yes CFLAGS='-O0 -g --coverage' CXXFLAGS='-O0 -g --coverage'
-
-matrix:
- fast_finish: true
- allow_failures:
-  - env: PHP=master enable_debug=yes enable_zts=yes enable_json=yes
-
-install:
- - |
-   if test "$PHP" = master; then \
-     make -f travis/pecl/Makefile reconf; \
-     make -f travis/pecl/Makefile pecl-rm pecl-clean PECL=raphf:raphf:2.0.0; \
-   fi
- - make -f travis/pecl/Makefile php || make -f travis/pecl/Makefile clean php
- - make -f travis/pecl/Makefile pecl PECL=raphf:raphf:2.0.0
-
-before_script:
- - psql -U postgres -c "CREATE DATABASE test"
-
-script:
- - make -f travis/pecl/Makefile ext PECL=pq
- - make -f travis/pecl/Makefile test
-
-after_success:
- - test -n "$CFLAGS" && cd src/.libs && bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
index 8aa9c32c99558054d2658192ad161d22b0909a76..a7d54c38b399acc935d11e7941b701571d9584f1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
 # pecl/pq
 
-[![Build Status](https://travis-ci.org/m6w6/ext-pq.svg?branch=master)](https://travis-ci.org/m6w6/ext-pq)
+[![Build Status](https://github.com/m6w6/ext-pq/workflows/ci/badge.svg?branch=master)](https://github.com/m6w6/ext-pq/actions?query=branch%3Amaster+workflow%3Aci)
+[![codecov](https://codecov.io/gh/m6w6/ext-pq/branch/master/graph/badge.svg?token=Nku9tz8EMj)](https://codecov.io/gh/m6w6/ext-pq)
 
 ## About:
 
@@ -19,7 +20,7 @@ See the [online markdown reference](https://mdref.m6w6.name/pq).
 
 Known issues are listed in [BUGS](./BUGS) and future ideas can be found in [TODO](./TODO).
 
-## Installing
+## Install
 
 ### PECL
 
diff --git a/scripts/ci b/scripts/ci
new file mode 160000 (submodule)
index 0000000..547c8e8
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 547c8e89e38d6e899914c05ddf6598669bd16532
diff --git a/scripts/gen_github_workflow_ci.php b/scripts/gen_github_workflow_ci.php
new file mode 100755 (executable)
index 0000000..94c0666
--- /dev/null
@@ -0,0 +1,91 @@
+#!/usr/bin/env php
+<?php echo "# generated file; do not edit!\n"; ?>
+
+name: ci
+on:
+  workflow_dispatch:
+  push:
+  pull_request:
+
+jobs:
+<?php
+
+$gen = include __DIR__ . "/ci/gen-matrix.php";
+$cur = "8.0";
+$job = $gen->github([
+"old-matrix" => [
+       "PHP" => ["7.0", "7.1", "7.2", "7.3", "7.4"],
+       "enable_debug" => "yes",
+       "enable_maintainer_zts" => "yes",
+       "enable_json" => "yes",
+       "enable_spl" => "yes",
+], 
+"master" => [
+    "PHP" => ["master"],
+    "enable_debug" => "yes",
+    "enable_zts" => "yes",
+    "enable_spl" => "yes",
+], 
+"cur-none" => [
+    "PHP" => $cur,
+], 
+"cur-dbg-zts" => [
+    "PHP" => $cur,
+    "enable_debug",
+    "enable_zts",
+    "enable_spl" => "yes",
+], 
+"cur-cov" => [
+    "CFLAGS" => "-O0 -g --coverage",
+    "CXXFLAGS" => "-O0 -g --coverage",
+    "PHP" => $cur,
+    "enable_spl" => "yes",
+]]);
+foreach ($job as $id => $env) {
+    printf("  %s:\n", $id);
+    printf("    name: %s\n", $id);
+    if ($env["PHP"] == "master") {
+        printf("    continue-on-error: true\n");
+    }
+    printf("    env:\n");
+    foreach ($env as $key => $val) {
+        printf("      %s: \"%s\"\n", $key, $val);
+    }
+?>
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Install
+        run: |
+          sudo apt-get install -y \
+            php-cli \
+            php-pear \
+            libpq-dev \
+            re2c
+      - name: Prepare
+        run: |
+          make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php
+          make -f scripts/ci/Makefile pecl PECL=m6w6/ext-raphf.git:raphf:master
+      - name: Build
+        run: |
+          make -f scripts/ci/Makefile ext PECL=pq
+      - name: Prepare Test
+        run: |
+          sudo systemctl start postgresql
+          sudo -u postgres createuser --login runner
+          sudo -u postgres createdb -O runner runner
+      - name: Test
+        run: |
+          make -f scripts/ci/Makefile test
+<?php if (isset($env["CFLAGS"]) && strpos($env["CFLAGS"], "--coverage") != false) : ?>
+      - name: Coverage
+        if: success()
+        run: |
+          cd src/.libs
+          bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
+<?php endif; ?>
+
+<?php
+}
diff --git a/scripts/gen_travis_yml.php b/scripts/gen_travis_yml.php
deleted file mode 100755 (executable)
index 2868592..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env php
-# autogenerated file; do not edit
-language: c
-
-addons:
- postgresql: 10
- apt:
-  packages:
-   - php-cli
-   - php-pear
-   - valgrind
-
-cache:
- directories:
-  - $HOME/cache
-
-before_cache:
- - find $HOME/cache -name '*.gcda' -o -name '*.gcno' -delete
-
-env:
- global:
-  - PQ_DSN="postgres://postgres@localhost/test"
- matrix:
-<?php
-
-$gen = include "./travis/pecl/gen-matrix.php";
-$cur = "8.0";
-$env = $gen([
-       "PHP" => ["7.0", "7.1", "7.2", "7.3", "7.4"],
-       "enable_debug" => "yes",
-       "enable_maintainer_zts" => "yes",
-       "enable_json" => "yes",
-], [
-       "PHP" => ["master"],
-       "enable_debug" => "yes",
-       "enable_zts" => "yes",
-       "enable_json" => "yes",
-], [
-       "PHP" => $cur,
-       "enable_json" => "no",
-], [
-       "PHP" => $cur,
-       "enable_json" => "yes",
-       "enable_debug",
-       "enable_zts"
-], [
-       "PHP" => $cur,
-       "enable_json" => "yes",
-       "CFLAGS" => "'-O0 -g --coverage'",
-       "CXXFLAGS" => "'-O0 -g --coverage'",
-]);
-
-foreach ($env as $g) {
-       foreach ($g as $e) {
-               printf("  - %s\n", $e);
-       }
-}
-?>
-
-matrix:
- fast_finish: true
- allow_failures:
-<?php
-$allow_failures = array_merge( ... array_map(function($a) {
-       return preg_grep('/^PHP=(master) /', $a);
-}, $env));
-foreach ($allow_failures as $e) {
-       printf("  - env: %s\n", $e);
-}
-?>
-
-install:
- - |
-   if test "$PHP" = master; then \
-     make -f travis/pecl/Makefile reconf; \
-     make -f travis/pecl/Makefile pecl-rm pecl-clean PECL=raphf:raphf:2.0.0; \
-   fi
- - make -f travis/pecl/Makefile php || make -f travis/pecl/Makefile clean php
- - make -f travis/pecl/Makefile pecl PECL=raphf:raphf:2.0.0
-
-before_script:
- - psql -U postgres -c "CREATE DATABASE test"
-
-script:
- - make -f travis/pecl/Makefile ext PECL=pq
- - make -f travis/pecl/Makefile test
-
-after_success:
- - test -n "$CFLAGS" && cd src/.libs && bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy
diff --git a/travis/pecl b/travis/pecl
deleted file mode 160000 (submodule)
index 4508f56..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 4508f562f8ef3c07b4490bef0e7563e73ef9a5f0