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