Codestyle + check trustedproxies
[dokuwiki.git] / .github / workflows / testLinux.yml
blob1ff9f109218639f4585add6f8afc4bd8141a8c18
1 name: Linux Unit Tests
3 on:
4   push:
5     branches-ignore:
6       - stable
7       - old-stable
8   pull_request:
10 permissions:
11   contents: read  #  to fetch code (actions/checkout)
13 jobs:
14     run:
15         name: PHP ${{ matrix.php-versions }}
16         runs-on: ubuntu-latest
17         if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
19         strategy:
20             matrix:
21                 php-versions: ['7.4', '8.0', '8.1', '8.2']
22             fail-fast: false
24         services:
25             mysql:
26                 image: mysql:5.7
27                 env:
28                     MYSQL_ALLOW_EMPTY_PASSWORD: yes
29                 ports:
30                     - 3306:3306
31             postgres:
32                 image: postgres:latest
33                 env:
34                     POSTGRES_PASSWORD: postgres
35                 ports:
36                     - 5432:5432
37             squid:
38               image: ubuntu/squid
39               ports:
40                     - 3128:3128
41         steps:
42             - name: Checkout
43               uses: actions/checkout@v3
45             - name: Setup PHP
46               uses: shivammathur/setup-php@v2
47               with:
48                   php-version: ${{ matrix.php-versions }}
49                   extensions: mbstring, intl, PDO, pdo_sqlite, pdo_mysql, pdo_pgsql, bz2
50                   ini-values: pcre.jit=0
52             - name: Setup problem matchers
53               run: |
54                 echo ::add-matcher::${{ runner.tool_cache }}/php.json
55                 echo ::add-matcher::${{ runner.tool_cache }}/phpunit.json
57             - name: Setup PHPUnit
58               run: |
59                   php _test/fetchphpunit.php
60                   cd _test
61                   cp mysql.conf.php.dist mysql.conf.php
62                   cp pgsql.conf.php.dist pgsql.conf.php
63                   cp proxy.conf.php.dist proxy.conf.php
65             - name: Run PHPUnit
66               run: |
67                 cd _test
68                 php phpunit.phar --verbose --stderr