Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame^] | 1 | name: "CI" |
| 2 | |
| 3 | on: |
| 4 | pull_request: |
| 5 | push: |
| 6 | branches: |
| 7 | - '3.x' |
| 8 | |
| 9 | env: |
| 10 | SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1 |
| 11 | |
| 12 | jobs: |
| 13 | tests: |
| 14 | name: "PHP ${{ matrix.php-version }}" |
| 15 | |
| 16 | runs-on: 'ubuntu-latest' |
| 17 | |
| 18 | continue-on-error: ${{ matrix.experimental }} |
| 19 | |
| 20 | strategy: |
| 21 | matrix: |
| 22 | php-version: |
| 23 | - '7.2.5' |
| 24 | - '7.3' |
| 25 | - '7.4' |
| 26 | - '8.0' |
| 27 | composer-options: [''] |
| 28 | experimental: [false] |
| 29 | include: |
| 30 | - { php-version: '8.1', experimental: true, composer-options: '--ignore-platform-req=php' } |
| 31 | |
| 32 | steps: |
| 33 | - name: "Checkout code" |
| 34 | uses: actions/checkout@v2.3.3 |
| 35 | |
| 36 | - name: "Install PHP with extensions" |
| 37 | uses: shivammathur/setup-php@2.7.0 |
| 38 | with: |
| 39 | coverage: "none" |
| 40 | php-version: ${{ matrix.php-version }} |
| 41 | ini-values: memory_limit=-1 |
| 42 | tools: composer:v2 |
| 43 | |
| 44 | - name: "Add PHPUnit matcher" |
| 45 | run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 46 | |
| 47 | - name: "Set composer cache directory" |
| 48 | id: composer-cache |
| 49 | run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 50 | |
| 51 | - name: "Cache composer" |
| 52 | uses: actions/cache@v2.1.2 |
| 53 | with: |
| 54 | path: ${{ steps.composer-cache.outputs.dir }} |
| 55 | key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }} |
| 56 | restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer- |
| 57 | |
| 58 | - run: composer install ${{ matrix.composer-options }} |
| 59 | |
| 60 | - name: "Install PHPUnit" |
| 61 | run: vendor/bin/simple-phpunit install |
| 62 | |
| 63 | - name: "PHPUnit version" |
| 64 | run: vendor/bin/simple-phpunit --version |
| 65 | |
| 66 | - name: "Run tests" |
| 67 | run: vendor/bin/simple-phpunit |
| 68 | |
| 69 | extension-tests: |
| 70 | needs: |
| 71 | - 'tests' |
| 72 | |
| 73 | name: "${{ matrix.extension }} with PHP ${{ matrix.php-version }}" |
| 74 | |
| 75 | runs-on: 'ubuntu-latest' |
| 76 | |
| 77 | continue-on-error: true |
| 78 | |
| 79 | strategy: |
| 80 | matrix: |
| 81 | php-version: |
| 82 | - '7.2.5' |
| 83 | - '7.3' |
| 84 | - '7.4' |
| 85 | - '8.0' |
| 86 | extension: |
| 87 | - 'extra/cache-extra' |
| 88 | - 'extra/cssinliner-extra' |
| 89 | - 'extra/html-extra' |
| 90 | - 'extra/inky-extra' |
| 91 | - 'extra/intl-extra' |
| 92 | - 'extra/markdown-extra' |
| 93 | - 'extra/string-extra' |
| 94 | - 'extra/twig-extra-bundle' |
| 95 | |
| 96 | steps: |
| 97 | - name: "Checkout code" |
| 98 | uses: actions/checkout@v2.3.3 |
| 99 | |
| 100 | - name: "Install PHP with extensions" |
| 101 | uses: shivammathur/setup-php@2.7.0 |
| 102 | with: |
| 103 | coverage: "none" |
| 104 | php-version: ${{ matrix.php-version }} |
| 105 | ini-values: memory_limit=-1 |
| 106 | tools: composer:v2 |
| 107 | |
| 108 | - name: "Add PHPUnit matcher" |
| 109 | run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 110 | |
| 111 | - name: "Set composer cache directory" |
| 112 | id: composer-cache |
| 113 | run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 114 | |
| 115 | - name: "Cache composer" |
| 116 | uses: actions/cache@v2.1.2 |
| 117 | with: |
| 118 | path: ${{ steps.composer-cache.outputs.dir }} |
| 119 | key: ${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.extension }}-${{ hashFiles('composer.json') }} |
| 120 | restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-${{ matrix.extension }}- |
| 121 | |
| 122 | - run: composer install |
| 123 | |
| 124 | - name: "Install PHPUnit" |
| 125 | run: vendor/bin/simple-phpunit install |
| 126 | |
| 127 | - name: "PHPUnit version" |
| 128 | run: vendor/bin/simple-phpunit --version |
| 129 | |
| 130 | - if: matrix.extension == 'extra/markdown-extra' && matrix.php-version == '8.0' |
| 131 | working-directory: ${{ matrix.extension}} |
| 132 | run: composer config platform.php 7.4.99 |
| 133 | |
| 134 | - name: "Composer install" |
| 135 | working-directory: ${{ matrix.extension}} |
| 136 | run: composer install |
| 137 | |
| 138 | - name: "Run tests" |
| 139 | working-directory: ${{ matrix.extension}} |
| 140 | run: ../../vendor/bin/simple-phpunit |
| 141 | # |
| 142 | # Drupal does not support Twig 3 now! |
| 143 | # |
| 144 | # integration-tests: |
| 145 | # needs: |
| 146 | # - 'tests' |
| 147 | # |
| 148 | # name: "Integration tests with PHP ${{ matrix.php-version }}" |
| 149 | # |
| 150 | # runs-on: 'ubuntu-20.04' |
| 151 | # |
| 152 | # continue-on-error: true |
| 153 | # |
| 154 | # strategy: |
| 155 | # matrix: |
| 156 | # php-version: |
| 157 | # - '7.3' |
| 158 | # |
| 159 | # steps: |
| 160 | # - name: "Checkout code" |
| 161 | # uses: actions/checkout@v2.3.3 |
| 162 | # |
| 163 | # - name: "Install PHP with extensions" |
| 164 | # uses: shivammathur/setup-php@2.7.0 |
| 165 | # with: |
| 166 | # coverage: "none" |
| 167 | # extensions: "gd, pdo_sqlite" |
| 168 | # php-version: ${{ matrix.php-version }} |
| 169 | # ini-values: memory_limit=-1 |
| 170 | # tools: composer:v2 |
| 171 | # |
| 172 | # - run: ./drupal_test.sh |
| 173 | # shell: "bash" |