xref: /dokuwiki/.github/workflows/testLinux.yml (revision 7aee97ee813f0e08e339a6f29e554d52bc4ef9d3)
12cf7c325SAndreas Gohrname: Linux Unit Tests
22cf7c325SAndreas Gohr
3bb6dfcb8SAndreas Gohron: [push, pull_request]
42cf7c325SAndreas Gohr
52cf7c325SAndreas Gohrjobs:
62cf7c325SAndreas Gohr    run:
72cf7c325SAndreas Gohr        name: PHP ${{ matrix.php-versions }}
82cf7c325SAndreas Gohr        runs-on: ubuntu-latest
9bb6dfcb8SAndreas Gohr        if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
102cf7c325SAndreas Gohr
112cf7c325SAndreas Gohr        strategy:
122cf7c325SAndreas Gohr            matrix:
13*7aee97eeSAndreas Gohr                php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
142cf7c325SAndreas Gohr            fail-fast: false
152cf7c325SAndreas Gohr
162cf7c325SAndreas Gohr        services:
172cf7c325SAndreas Gohr            mysql:
182cf7c325SAndreas Gohr                image: mysql:5.7
192cf7c325SAndreas Gohr                env:
202cf7c325SAndreas Gohr                    MYSQL_ALLOW_EMPTY_PASSWORD: yes
212cf7c325SAndreas Gohr                ports:
222cf7c325SAndreas Gohr                    - 3306:3306
232cf7c325SAndreas Gohr            postgres:
242cf7c325SAndreas Gohr                image: postgres:latest
252cf7c325SAndreas Gohr                env:
262cf7c325SAndreas Gohr                    POSTGRES_PASSWORD: postgres
272cf7c325SAndreas Gohr                ports:
282cf7c325SAndreas Gohr                    - 5432:5432
292cf7c325SAndreas Gohr        steps:
302cf7c325SAndreas Gohr            - name: Checkout
312cf7c325SAndreas Gohr              uses: actions/checkout@v2
322cf7c325SAndreas Gohr
332cf7c325SAndreas Gohr            - name: Setup PHP
342cf7c325SAndreas Gohr              uses: shivammathur/setup-php@v2
352cf7c325SAndreas Gohr              with:
362cf7c325SAndreas Gohr                  php-version: ${{ matrix.php-versions }}
372cf7c325SAndreas Gohr                  extensions: mbstring, intl, PDO, pdo_sqlite, pdo_mysql, pdo_pgsql, bz2
3889c597eaSAndreas Gohr                  ini-values: pcre.jit=0
392cf7c325SAndreas Gohr
402cf7c325SAndreas Gohr            - name: Setup problem matchers
412cf7c325SAndreas Gohr              run: |
422cf7c325SAndreas Gohr                echo ::add-matcher::${{ runner.tool_cache }}/php.json
432cf7c325SAndreas Gohr                echo ::add-matcher::${{ runner.tool_cache }}/phpunit.json
442cf7c325SAndreas Gohr
452cf7c325SAndreas Gohr            - name: Setup PHPUnit
462cf7c325SAndreas Gohr              run: |
472cf7c325SAndreas Gohr                  php _test/fetchphpunit.php
482cf7c325SAndreas Gohr                  cd _test
492cf7c325SAndreas Gohr                  cp mysql.conf.php.dist mysql.conf.php
502cf7c325SAndreas Gohr                  cp pgsql.conf.php.dist pgsql.conf.php
512cf7c325SAndreas Gohr
522cf7c325SAndreas Gohr            - name: Run PHPUnit
532cf7c325SAndreas Gohr              run: |
542cf7c325SAndreas Gohr                cd _test
552cf7c325SAndreas Gohr                php phpunit.phar --verbose --stderr
56