3 on: [push, pull_request]
7 runs-on: ${{ matrix.operating-system }}
10 URI: /demo/server/server.php
11 HTTPSSERVER: localhost
12 HTTPSURI: /demo/server/server.php
13 PROXYSERVER: localhost:8080
14 # @todo check: is this necessary as well on GHA runners?
15 # was: Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
16 # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below.
24 # @see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
25 # @todo fix: atm our tests fail when using ubuntu 20 (focal) and php 5.6 - 7.1, when using
26 # an ssl stream context for connecting to localhost via https
27 operating-system: ['ubuntu-18.04'] # @todo add 'windows-latest'
28 # @todo use an older version of phpunit to enable testing on php 5.3 - 5.5 . Also: we will most likely
29 # have to resort to using shivammathur/setup-php@v2 instead of sury's ppa to get php installed
30 php: ['8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6']
33 uses: actions/checkout@v2
34 # Although this action is useful, we prefer to use the same script to set up php that we use for the
35 # docker image used for local testing. This allows us to make sure that script is always in good shape
37 # uses: shivammathur/setup-php@v2
39 # php-version: ${{ matrix.php }}
40 # extensions: curl, dom, mbstring, xsl
41 # ini-values: 'cgi.fix_pathinfo=1, always_populate_raw_post_data=-1'
42 # #tools: phpunit/phpunit:a_version_compatible_with_php_5.3-5.5
43 # # NB: this disables xdebug completely
46 # @todo add env setup scripts for windows
48 chmod 755 ./tests/ci/setup/*.sh
49 sudo --preserve-env=GITHUB_ACTIONS ./tests/ci/setup/setup_perl.sh
50 sudo --preserve-env=GITHUB_ACTIONS ./tests/ci/setup/setup_apache.sh
51 sudo --preserve-env=GITHUB_ACTIONS ./tests/ci/setup/setup_privoxy.sh
52 sudo --preserve-env=GITHUB_ACTIONS ./tests/ci/setup/setup_php.sh ${{ matrix.php }}
53 sudo --preserve-env=GITHUB_ACTIONS ./tests/ci/setup/setup_composer.sh
54 # Avoid downloading composer deps on every workflow. Is this useful/working for us?
56 # uses: actions/cache@v2
58 # path: /tmp/composer-cache
59 # key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
61 run: 'composer install'
63 if: ${{ matrix.php == '7.4' }}
65 ./tests/ci/setup/setup_code_coverage.sh enable
66 ./vendor/bin/phpunit -v --coverage-clover=coverage.clover tests
67 if [ -f coverage.clover ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
69 if: ${{ matrix.php != '7.4' }}
70 run: './vendor/bin/phpunit -v tests'
72 run: 'python3 demo/client/python/test.py'
74 run: 'perl demo/client/perl/test.pl'
81 #dpkg --list | grep php
85 #systemctl status apache2.service
86 #ls -la /etc/apache2/mods-enabled
87 #ls -la /etc/apache2/conf-enabled
88 #ls -la /etc/apache2/mods-available
89 #ls -la /etc/apache2/conf-available
90 #ls -la /etc/apache2/sites-available/
91 #sudo cat /etc/apache2/envvars
92 #sudo cat /etc/apache2/sites-available/000-default.conf
94 #ls -ltr /var/log/apache2
95 sudo cat /var/log/privoxy/*
96 sudo cat /var/log/apache2/error.log
97 sudo cat /var/log/apache2/other_vhosts_access.log
98 sudo cat /var/log/php*.log