From 42cfc3bd986d24f7172e5e45a9959f782b65d010 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 15 Jan 2021 10:26:19 +0100 Subject: [PATCH] travis -> gh-actions --- .github/workflows/ci.yml | 390 +++++++++++++++++++++++++++++ .gitmodules | 7 +- .travis.yml | 41 --- README.md | 5 +- gen_travis_yml.php | 57 ----- scripts/ci | 1 + scripts/gen_github_workflow_ci.php | 76 ++++++ travis/pecl | 1 - 8 files changed, 473 insertions(+), 105 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100755 gen_travis_yml.php create mode 160000 scripts/ci create mode 100755 scripts/gen_github_workflow_ci.php delete mode 160000 travis/pecl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1b1d5fa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,390 @@ +# 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" + PECLs: "propro,pecl_http:http:3.2.4" + 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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "propro,pecl_http:http:3.2.4" + 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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "propro,pecl_http:http:3.2.4" + 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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "propro,pecl_http:http:3.2.4" + 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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "propro,pecl_http:http:3.2.4" + 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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "m6w6/ext-http:http:master" + 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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "pecl_http:http:4.0.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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "pecl_http:http:4.0.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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "pecl_http:http:4.0.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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - 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" + PECLs: "pecl_http:http:4.0.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 \ + libcurl4-openssl-dev \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=raphf + - name: Prepare Test + run: | + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + - name: Test + run: | + make -f scripts/ci/Makefile test + 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 7b4e48a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -# autogenerated file; do not edit -language: c - -addons: - apt: - packages: - - php-cli - - php-pear - - valgrind - -env: - matrix: - - PHP=5.6 enable_debug=yes enable_maintainer_zts=yes enable_json=yes - - 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_maintainer_zts=yes enable_json=yes - - PHP=8.0 enable_debug=no enable_maintainer_zts=no enable_json=yes - - PHP=8.0 enable_debug=yes enable_maintainer_zts=no enable_json=yes - - PHP=8.0 enable_debug=no enable_maintainer_zts=yes enable_json=yes - - PHP=8.0 enable_debug=yes enable_maintainer_zts=yes enable_json=yes - - CFLAGS='-O0 -g --coverage' CXXFLAGS='-O0 -g --coverage' PHP=8.0 enable_json=yes - -cache: - directories: - - $HOME/cache - -before_cache: - - find $HOME/cache -name '*.gcda' -o -name '*.gcno' -delete - -install: - - make -f travis/pecl/Makefile php - -script: - - make -f travis/pecl/Makefile ext PECL=json_post - - make -f travis/pecl/Makefile test - -after_success: - - test -n "$CFLAGS" && cd .libs && bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy diff --git a/README.md b/README.md index 689ee8c..bb0304a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # ext-json_post -[![Build Status](https://travis-ci.org/m6w6/ext-json_post.svg?branch=master)](https://travis-ci.org/m6w6/ext-json_post) +[![Build Status](https://github.com/m6w6/ext-json_post/workflows/ci/badge.svg?branch=master)](https://github.com/m6w6/ext-json_post/actions?query=branch%3Amaster+workflow%3Aci) +[![codecov](https://codecov.io/gh/m6w6/ext-json_post/branch/master/graph/badge.svg?token=Nku9tz8EMj)](https://codecov.io/gh/m6w6/ext-json_post) JSON POST handler @@ -8,7 +9,7 @@ JSON POST handler See the [online markdown reference](https://mdref.m6w6.name/json_post). -## Installing +## Install ### PECL diff --git a/gen_travis_yml.php b/gen_travis_yml.php deleted file mode 100755 index ba9d41d..0000000 --- a/gen_travis_yml.php +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env php -# autogenerated file; do not edit -language: c - -addons: - apt: - packages: - - php-cli - - php-pear - - valgrind - -env: - matrix: - ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "master"], - "enable_debug" => "yes", - "enable_maintainer_zts" => "yes", - "enable_json" => "yes" -], [ - "PHP" => $cur, - "enable_debug", - "enable_maintainer_zts", - "enable_json" => "yes" -], [ - "CFLAGS" => "'-O0 -g --coverage'", - "CXXFLAGS" => "'-O0 -g --coverage'", - "PHP" => $cur, - "enable_json" => "yes" -]); -foreach ($env as $grp) { - foreach ($grp as $e) { - printf(" - %s\n", $e); - } -} - -?> - -cache: - directories: - - $HOME/cache - -before_cache: - - find $HOME/cache -name '*.gcda' -o -name '*.gcno' -delete - -install: - - make -f travis/pecl/Makefile php - -script: - - make -f travis/pecl/Makefile ext PECL=json_post - - make -f travis/pecl/Makefile test - -after_success: - - test -n "$CFLAGS" && cd .libs && bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy 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..3c7761b --- /dev/null +++ b/scripts/gen_github_workflow_ci.php @@ -0,0 +1,76 @@ +#!/usr/bin/env php + + +name: ci +on: + workflow_dispatch: + push: + pull_request: + +jobs: +github([ +"old-matrix" => [ + "PHP" => ["5.6", "7.0", "7.1", "7.2", "7.3", "7.4"], + "enable_debug" => "yes", + "enable_maintainer_zts" => "yes", +], +"master" => [ + "PHP" => "master", + "enable_debug" => "yes", + "enable_zts" => "yes", +], +"cur-dbg-zts" => [ + "PHP" => $cur, + "enable_debug", + "enable_zts", +], +"cur-cov" => [ + "CFLAGS" => "-O0 -g --coverage", + "CXXFLAGS" => "-O0 -g --coverage", + "PHP" => $cur, +]]); +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 \ + re2c + - name: Prepare + run: | + make -f scripts/ci/Makefile php || make -f scripts/ci/Makefile clean php + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=json_post + - name: Test + run: | + make -f scripts/ci/Makefile test + + - name: Coverage + if: success() + run: | + cd .libs + bash <(curl -s https://codecov.io/bash) -X xcode -X coveragepy + + +