oops
[plcapi.git] / .github / workflows / ci.yml
1 name: CI
2
3 on: [push]
4
5 jobs:
6     test:
7         runs-on: ${{ matrix.operating-system }}
8         env:
9             HTTPSERVER: localhost
10             URI: /demo/server/server.php
11             HTTPSSERVER: localhost
12             HTTPSURI: /demo/server/server.php
13             PROXYSERVER: localhost:8080
14             # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
15             # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
16             HTTPSVERIFYHOST: 0
17             HTTPSIGNOREPEER: 1
18             SSLVERSION: 0
19             DEBUG: 0
20         strategy:
21             fail-fast: false
22             matrix:
23                 operating-system: ['ubuntu-latest'] # @todo add 'windows-latest'
24                 # @todo use an older version of phpunit to enable testing on php 5.3 - 5.5
25                 php: ['8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6']
26         steps:
27             -
28                 uses: actions/checkout@v2
29             # Although this action is useful, we prefer to use the same script to set up php that we use for the
30             # docker image used for local testing. This allows us to make sure that script is always in good shape
31             #-
32             #    uses: shivammathur/setup-php@v2
33             #    with:
34             #        php-version: ${{ matrix.php }}
35             #        extensions: curl, dom, mbstring, xsl
36             #        ini-values: 'cgi.fix_pathinfo=1, always_populate_raw_post_data=-1'
37             #        #tools: phpunit/phpunit:a_version_compatible_with_php_5.3-5.5
38             #        # NB: this disables xdebug completely
39             #        coverage: none
40             -
41                 # @todo add config setup scripts for windows
42                 run: |
43                     chmod 755 ./tests/ci/setup/*.sh
44                     sudo ./tests/ci/setup/setup_perl.sh
45                     sudo ./tests/ci/setup/setup_apache.sh
46                     sudo ./tests/ci/setup/setup_privoxy.sh
47                     sudo ./tests/ci/setup/setup_php.sh ${{ matrix.php }}
48                     sudo ./tests/ci/setup/setup_composer.sh
49             # Avoid downloading composer deps on every workflow. Is this useful/working for us?
50             #-
51             #    uses: actions/cache@v2
52             #    with:
53             #        path: /tmp/composer-cache
54             #        key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
55             -
56                 run: 'composer install'
57             -
58                 if: ${{ matrix.php == '7.4' }}
59                 run: './tests/ci/setup/setup_code_coverage.sh enable'
60             -
61                 # @todo bring back $PHPUNIT_OPTS to trigger code coverage
62                 run: './vendor/bin/phpunit -v tests'
63             -
64                 run: 'python3 demo/client/python/test.py'
65             -
66                 run: 'perl demo/client/perl/test.pl'
67             -
68                 if: ${{ failure() }}
69                 run: |
70                     systemctl status apache2.service
71                     ls -la /etc/apache2/mods-enabled
72                     ls -la /etc/apache2/conf-enabled
73                     ls -la /etc/apache2/mods-available
74                     ls -la /etc/apache2/conf-available
75                     sudo cat /var/log/apache2/error.log
76                     sudo cat /var/log/apache2/other_vhosts_access.log
77                     #env
78                     #php -i
79                     #sudo cat /var/log/privoxy/*
80                     #sudo cat /var/log/php*.log