|
1 | 1 | # https://help.github.com/en/categories/automating-your-workflow-with-github-actions |
2 | 2 |
|
3 | 3 | on: |
4 | | - - "pull_request" |
5 | | - - "push" |
| 4 | + - pull_request |
| 5 | + - push |
6 | 6 |
|
7 | | -name: "CI" |
| 7 | +name: CI |
| 8 | + |
| 9 | +env: |
| 10 | + COMPOSER_ROOT_VERSION: "9.2-dev" |
8 | 11 |
|
9 | 12 | jobs: |
10 | 13 | coding-guidelines: |
11 | | - name: "Coding Guidelines" |
| 14 | + name: Coding Guidelines |
12 | 15 |
|
13 | | - runs-on: "ubuntu-latest" |
| 16 | + runs-on: ubuntu-latest |
14 | 17 |
|
15 | 18 | steps: |
16 | | - - name: "Checkout" |
17 | | - uses: "actions/checkout@v2" |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - name: Install PHP |
| 23 | + uses: shivammathur/setup-php@v2 |
| 24 | + with: |
| 25 | + php-version: 8.0 |
| 26 | + extensions: :apcu, :imagick |
| 27 | + coverage: none |
| 28 | + tools: none |
18 | 29 |
|
19 | | - - name: "Run friendsofphp/php-cs-fixer" |
20 | | - run: "php7.4 ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose" |
| 30 | + - name: Run friendsofphp/php-cs-fixer |
| 31 | + run: ./tools/php-cs-fixer fix --dry-run --show-progress=dots --using-cache=no --verbose |
21 | 32 |
|
22 | 33 | type-checker: |
23 | | - name: "Type Checker" |
| 34 | + name: Type Checker |
24 | 35 |
|
25 | | - runs-on: "ubuntu-latest" |
| 36 | + runs-on: ubuntu-latest |
26 | 37 |
|
27 | 38 | steps: |
28 | | - - name: "Checkout" |
29 | | - uses: "actions/checkout@v2" |
30 | | - |
31 | | - - name: "Install PHP with extensions" |
32 | | - uses: "shivammathur/setup-php@v2" |
33 | | - with: |
34 | | - php-version: "7.4" |
35 | | - coverage: "pcov" |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v2 |
36 | 41 |
|
37 | | - - name: "Cache dependencies installed with composer" |
38 | | - uses: "actions/cache@v2" |
| 42 | + - name: Install PHP |
| 43 | + uses: shivammathur/setup-php@v2 |
39 | 44 | with: |
40 | | - path: "~/.composer/cache" |
41 | | - key: "php7.4-composer-${{ hashFiles('**/composer.json') }}" |
42 | | - restore-keys: "php7.4-composer-" |
| 45 | + php-version: 8.0 |
| 46 | + extensions: :apcu, :imagick |
| 47 | + coverage: none |
| 48 | + tools: none |
43 | 49 |
|
44 | | - - name: "Update dependencies with composer" |
45 | | - run: "./tools/composer update --no-ansi --no-interaction --no-progress" |
| 50 | + - name: Update dependencies with composer |
| 51 | + run: ./tools/composer update --no-interaction --no-ansi --no-progress |
46 | 52 |
|
47 | | - - name: "Run vimeo/psalm" |
48 | | - run: "./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats" |
| 53 | + - name: Run vimeo/psalm |
| 54 | + run: ./tools/psalm --config=.psalm/config.xml --no-progress --shepherd --show-info=false --stats |
49 | 55 |
|
50 | 56 | tests: |
51 | | - name: "Tests" |
| 57 | + name: Tests |
52 | 58 |
|
53 | | - runs-on: "ubuntu-latest" |
| 59 | + runs-on: ${{ matrix.os }} |
| 60 | + |
| 61 | + env: |
| 62 | + PHP_EXTENSIONS: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter, :apcu, :imagick |
| 63 | + PHP_INI_VALUES: memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On |
54 | 64 |
|
55 | 65 | strategy: |
56 | 66 | fail-fast: false |
57 | 67 | matrix: |
| 68 | + os: |
| 69 | + - ubuntu-latest |
| 70 | + - windows-latest |
| 71 | + |
58 | 72 | php-version: |
59 | 73 | - "7.3" |
60 | 74 | - "7.4" |
61 | 75 | - "8.0" |
| 76 | + - "8.1" |
62 | 77 |
|
63 | 78 | coverage-driver: |
64 | 79 | - "pcov" |
65 | 80 | - "xdebug" |
66 | 81 | - "xdebug3" |
67 | 82 |
|
| 83 | + compiler: |
| 84 | + - default |
| 85 | + |
| 86 | + dependencies: |
| 87 | + - lowest |
| 88 | + - highest |
| 89 | + |
| 90 | + include: |
| 91 | + - os: ubuntu-latest |
| 92 | + php-version: "8.0" |
| 93 | + compiler: jit |
| 94 | + dependencies: highest |
| 95 | + |
| 96 | + - os: ubuntu-latest |
| 97 | + php-version: "8.1" |
| 98 | + compiler: jit |
| 99 | + dependencies: highest |
| 100 | + |
68 | 101 | exclude: |
69 | 102 | - php-version: "8.0" |
70 | 103 | coverage-driver: "xdebug" |
71 | 104 |
|
| 105 | + - php-version: "8.1" |
| 106 | + coverage-driver: "xdebug" |
| 107 | + |
72 | 108 | steps: |
73 | | - - name: "Checkout" |
74 | | - uses: "actions/checkout@v2" |
| 109 | + - name: Configure git to avoid issues with line endings |
| 110 | + if: matrix.os == 'windows-latest' |
| 111 | + run: git config --global core.autocrlf false |
75 | 112 |
|
76 | | - - name: "Install PHP" |
77 | | - uses: "shivammathur/setup-php@v2" |
78 | | - with: |
79 | | - php-version: "${{ matrix.php-version }}" |
80 | | - coverage: "${{ matrix.coverage-driver }}" |
| 113 | + - name: Checkout |
| 114 | + uses: actions/checkout@v2 |
| 115 | + |
| 116 | + - name: Override PHP ini values for JIT compiler |
| 117 | + if: matrix.compiler == 'jit' |
| 118 | + run: echo "PHP_INI_VALUES::assert.exception=1, memory_limit=-1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M" >> $GITHUB_ENV |
81 | 119 |
|
82 | | - - name: "Cache dependencies installed with composer" |
83 | | - uses: "actions/cache@v2" |
| 120 | + - name: Install PHP with extensions |
| 121 | + uses: shivammathur/setup-php@v2 |
84 | 122 | with: |
85 | | - path: "~/.composer/cache" |
86 | | - key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}" |
87 | | - restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" |
| 123 | + php-version: ${{ matrix.php-version }} |
| 124 | + coverage: ${{ matrix.coverage-driver }} |
| 125 | + extensions: ${{ env.PHP_EXTENSIONS }} |
| 126 | + ini-values: ${{ env.PHP_INI_VALUES }} |
| 127 | + tools: none |
88 | 128 |
|
89 | | - - name: "Install dependencies with composer" |
90 | | - run: "./tools/composer update --no-ansi --no-interaction --no-progress" |
| 129 | + - name: Install lowest dependencies with composer |
| 130 | + if: matrix.dependencies == 'lowest' |
| 131 | + run: php ./tools/composer update --no-ansi --no-interaction --no-progress --prefer-lowest |
91 | 132 |
|
92 | | - - name: "Run tests with phpunit/phpunit" |
93 | | - run: "vendor/bin/phpunit --coverage-clover=coverage.xml" |
| 133 | + - name: Install highest dependencies with composer |
| 134 | + if: matrix.dependencies == 'highest' |
| 135 | + run: php ./tools/composer update --no-ansi --no-interaction --no-progress |
94 | 136 |
|
95 | | - - name: "Send code coverage report to Codecov.io" |
96 | | - env: |
97 | | - CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" |
98 | | - run: "bash <(curl -s https://codecov.io/bash) || true" |
| 137 | + - name: Run tests with phpunit/phpunit |
| 138 | + run: vendor/bin/phpunit --coverage-clover=coverage.xml |
| 139 | + |
| 140 | + - name: Send code coverage report to Codecov.io |
| 141 | + uses: codecov/codecov-action@v1 |
| 142 | + with: |
| 143 | + token: ${{ secrets.CODECOV_TOKEN }} |
0 commit comments