aboutsummaryrefslogtreecommitdiffstats
path: root/php/tcpdf/.github/workflows/tests.yml
blob: 64f2214a98ba1cf998133aaef8ec8ecff8abd877 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Run tests

on:
  push:
  pull_request:
    types: [opened, synchronize, reopened]
    branches:
      - main

jobs:
    test-php:
        name: Test on php ${{ matrix.php-version }} and ${{ matrix.os }}
        runs-on: ${{ matrix.os }}
        continue-on-error: ${{ matrix.experimental }}
        strategy:
            fail-fast: false
            matrix:
                experimental: [false]
                coverage-extension: [pcov]
                php-version: ["7.1", "7.2", "7.3", "7.4", "8.0"]
                os: [ubuntu-latest]
                include:
                    - { php-version: '5.3', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
                    - { php-version: '5.4', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
                    - { php-version: '5.5', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
                    - { php-version: '5.6', experimental: false, os: ubuntu-latest, coverage-extension: 'xdebug' }
                    - { php-version: '8.1', experimental: true, os: ubuntu-latest, coverage-extension: 'pcov' }
        steps:
            - uses: actions/checkout@v2
            - name: Install pdfinfo
              run: sudo apt-get install -y poppler-utils
            - name: Use php ${{ matrix.php-version }}
              uses: shivammathur/setup-php@v2
              with:
                  php-version: ${{ matrix.php-version }}
                  coverage: ${{ matrix.coverage-extension }}
                  extensions: bcmath, imagick, gd
                  ini-values: display_errors=on, error_reporting=-1
            - name: List php modules
              run: php -m
            - name: List php modules using "no php ini" mode
              run: php -m -n
            - name: Cache module
              uses: actions/cache@v2
              with:
                  path: ~/.composer/cache/
                  key: composer-cache
            - name: Install dependencies
              run: composer install --no-interaction
            - name: Run php tests
              run: ./tests/launch.sh
            - name: Send coverage
              uses: codecov/codecov-action@v1
              with:
                flags: php-${{ matrix.php-version }}-${{ matrix.os }}
                name: php-${{ matrix.php-version }}-${{ matrix.os }}