X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-apfd;a=blobdiff_plain;f=scripts%2Fgen_github_workflow_ci.php;fp=scripts%2Fgen_github_workflow_ci.php;h=5986230ce5f69b0d18ea74b55e37be8bcd2990ec;hp=0000000000000000000000000000000000000000;hb=26afca22652e1f579966787e0c2219267a7aaae7;hpb=c890a6eec0d636900be67cb2d78cf310b5aaab0d diff --git a/scripts/gen_github_workflow_ci.php b/scripts/gen_github_workflow_ci.php new file mode 100755 index 0000000..5986230 --- /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=apfd + - 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 + + +