X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=scripts%2Fgen_github_workflow_ci.php;fp=scripts%2Fgen_github_workflow_ci.php;h=5970cc0556524e5de8e336eb991e8a9c5e329d14;hb=c99ff28a0da10b58425aa020f4a9cef7844b7726;hp=0000000000000000000000000000000000000000;hpb=3a4f177092dec08373761f535e47bdd7a371d52a;p=m6w6%2Fext-http diff --git a/scripts/gen_github_workflow_ci.php b/scripts/gen_github_workflow_ci.php new file mode 100755 index 0000000..5970cc0 --- /dev/null +++ b/scripts/gen_github_workflow_ci.php @@ -0,0 +1,120 @@ +#!/usr/bin/env php + + +name: ci +on: + workflow_dispatch: + push: + pull_request: + +jobs: +github([ +"old-matrix" => [ +// most useful for all additional versions except current + "PHP" => ["7.0", "7.1", "7.2", "7.3"], + "enable_debug" => "yes", + "enable_maintainer_zts" => "yes", + "enable_json" => "yes", + "enable_hash" => "yes", + "enable_iconv" => "yes", +], +"cur-none" => [ +// everything disabled for current + "PHP" => $cur, + "with_http_libicu_dir" => "no", + "with_http_libidn_dir" => "no", + "with_http_libidn2_dir" => "no", + "with_http_libcurl_dir" => "no", + "with_http_libevent_dir" => "no", + "with_http_libbrotli_dir" => "no", +], +"cur-dbg-zts" => [ +// everything enabled for current, switching debug/zts + "PHP" => $cur, + "PECLs" => "event", // for tests/client029.phpt + "enable_sockets" => "yes", // needed by pecl/event + "enable_debug", + "enable_maintainer_zts", + "enable_json" => "yes", + "enable_hash" => "yes", + "enable_iconv" => "yes", +], +"cur-cov" => [ +// once everything enabled for current, with coverage + "CFLAGS" => "'-O0 -g --coverage'", + "CXXFLAGS" => "'-O0 -g --coverage'", + "PHP" => $cur, + "PECLs" => "event", // for tests/client029.phpt + "enable_sockets" => "yes", // needed by pecl/event + "enable_json" => "yes", + "enable_hash" => "yes", + "enable_iconv" => "yes", + [ + "with_http_libicu_dir", + "with_http_libidn_dir", + "with_http_libidn2_dir", + ], +]]); + +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 \ + libcurl4-openssl-dev \ + libevent-dev \ + libidn11-dev \ + libidn2-0-dev \ + libicu-dev \ + libevent-dev \ + libbrotli-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 + make -f scripts/ci/Makefile pecl PECL=ext-propro.git:propro:master + if test -n "$PECLs"; then + IFS=$',' + for pecl in $PECLs; do + make -f scripts/ci/Makefile pecl PECL=$pecl + done + unset IFS + fi + + - name: Build + run: | + make -f scripts/ci/Makefile ext PECL=http + - 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 + + +