X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=.github%2Fworkflows%2Fci.yml;h=b341f685fa57ca506b942c4686d9fa425eab7a01;hb=239391c98a446647086cb650f95b13184242bfb4;hp=c4d6aa9f96faff1a1048902fbfd681e762e16dc1;hpb=bf9efa344d27bd2c63aa77d083aa2de57494de41;p=plcapi.git diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4d6aa9..b341f68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: [push] jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.operating-system }} env: HTTPSERVER: localhost URI: /demo/server/server.php @@ -12,7 +12,8 @@ jobs: HTTPSURI: /demo/server/server.php PROXYSERVER: localhost:8080 # Travis currently compiles PHP with an oldish cURL/GnuTLS combination; - # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below + # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below. + # @todo check: is this necessary as well on GHA runners? HTTPSVERIFYHOST: 0 HTTPSIGNOREPEER: 1 SSLVERSION: 0 @@ -20,40 +21,69 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4', '5.3'] + operating-system: ['ubuntu-latest'] # @todo add 'windows-latest' + # @todo use an older version of phpunit to enable testing on php 5.3 - 5.5 + php: ['8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6'] steps: - - - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, dom, mbstring, xsl - #tools: phpunit - #- - # run: 'php -v && env' - uses: actions/checkout@v2 + # Although this action is useful, we prefer to use the same script to set up php that we use for the + # docker image used for local testing. This allows us to make sure that script is always in good shape + #- + # uses: shivammathur/setup-php@v2 + # with: + # php-version: ${{ matrix.php }} + # extensions: curl, dom, mbstring, xsl + # ini-values: 'cgi.fix_pathinfo=1, always_populate_raw_post_data=-1' + # #tools: phpunit/phpunit:a_version_compatible_with_php_5.3-5.5 + # # NB: this disables xdebug completely + # coverage: none - - run: 'chmod 755 ./tests/ci/setup/*.sh && sudo ./tests/ci/setup/setup_perl.sh && sudo ./tests/ci/setup/setup_apache.sh && sudo ./tests/ci/setup/setup_privoxy.sh' - # Avoid downloading composer deps on every workflow. Is this useful for us? + # @todo add config setup scripts for windows + run: | + chmod 755 ./tests/ci/setup/*.sh + sudo ./tests/ci/setup/setup_perl.sh + sudo ./tests/ci/setup/setup_apache.sh + sudo ./tests/ci/setup/setup_privoxy.sh + sudo ./tests/ci/setup/setup_php.sh ${{ matrix.php }} + sudo ./tests/ci/setup/setup_composer.sh + # Avoid downloading composer deps on every workflow. Is this useful/working for us? #- # uses: actions/cache@v2 # with: # path: /tmp/composer-cache # key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} - - uses: php-actions/composer@v6 - # simpler alternative ? - #run: 'composer install' + run: 'composer install' - if: ${{ matrix.php == '7.4' }} run: './tests/ci/setup/setup_code_coverage.sh enable' - - # @todo bring back $PHPUNIT_OPTS + # @todo bring back $PHPUNIT_OPTS to trigger code coverage run: './vendor/bin/phpunit -v tests' - run: 'python3 demo/client/python/test.py' - run: 'perl demo/client/perl/test.pl' - - if: ${{ failure() }} - run: 'systemctl status apache2.service; env; php -i; sudo cat /var/log/privoxy/*; sudo cat /var/log/apache2/error.log; sudo cat /var/log/apache2/other_vhosts_access.log; sudo cat /var/log/php*.log' + if: ${{ failure() }} + run: | + #env + #php -i + #ps auxwww + dpkg --list | grep php + ps auxwww | grep fpm + pwd + sudo env + #systemctl status apache2.service + #ls -la /etc/apache2/mods-enabled + #ls -la /etc/apache2/conf-enabled + #ls -la /etc/apache2/mods-available + #ls -la /etc/apache2/conf-available + #ls -la /etc/apache2/sites-available/ + #sudo cat /etc/apache2/envvars + #sudo cat /etc/apache2/sites-available/000-default.conf + sudo cat /var/log/privoxy/* + sudo cat /var/log/apache2/error.log + sudo cat /var/log/apache2/other_vhosts_access.log + sudo cat /var/log/php*.log