From 2bff1a14bb1eb2a8a0c77c75b12e809908812eeb Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 15 Jan 2021 12:01:02 +0100 Subject: [PATCH] travis -> gh-actions --- .gitattributes | 1 - .github/workflows/ci.yml | 437 +++++++++++++++++++++++++++++ .gitmodules | 7 +- .travis.yml | 58 ---- README.md | 5 +- scripts/ci | 1 + scripts/gen_github_workflow_ci.php | 91 ++++++ scripts/gen_travis_yml.php | 89 ------ travis/pecl | 1 - 9 files changed, 535 insertions(+), 155 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 160000 scripts/ci create mode 100755 scripts/gen_github_workflow_ci.php delete mode 100755 scripts/gen_travis_yml.php delete mode 160000 travis/pecl diff --git a/.gitattributes b/.gitattributes index 29df74b..8b60805 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 index 0000000..ad63594 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 + diff --git a/.gitmodules b/.gitmodules index e53f88c..72fd52f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 index f8d6312..0000000 --- a/.travis.yml +++ /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 diff --git a/README.md b/README.md index 8aa9c32..a7d54c3 100644 --- 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 index 0000000..547c8e8 --- /dev/null +++ b/scripts/ci @@ -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 index 0000000..94c0666 --- /dev/null +++ b/scripts/gen_github_workflow_ci.php @@ -0,0 +1,91 @@ +#!/usr/bin/env php + + +name: ci +on: + workflow_dispatch: + push: + pull_request: + +jobs: +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 + + - name: Coverage + if: success() + run: | + cd src/.libs + bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy + + + ["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: - - -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 index 4508f56..0000000 --- a/travis/pecl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4508f562f8ef3c07b4490bef0e7563e73ef9a5f0 -- 2.30.2