|
85 | 85 | name: phpunit-logs-${{ runner.os }}-${{ matrix.php }}-${{ steps.version-cache.outputs.major }}-${{ matrix.coverage }}
|
86 | 86 | path: .Log/*
|
87 | 87 | retention-days: 1
|
| 88 | + |
| 89 | + merge: |
| 90 | + name: 'Merge COVERAGE: ${{ matrix.coverage }} - PHP: ${{ matrix.php }}' |
| 91 | + |
| 92 | + needs: [ compute, build ] |
| 93 | + |
| 94 | + strategy: |
| 95 | + fail-fast: false |
| 96 | + matrix: |
| 97 | + os: ${{ fromJson(needs.compute.outputs.os) }} |
| 98 | + coverage: ${{ fromJson(needs.compute.outputs.major) }} |
| 99 | + php: ${{ fromJson(needs.compute.outputs.php) }} |
| 100 | + exclude: ${{ fromJson(needs.compute.outputs.exclude) }} |
| 101 | + |
| 102 | + runs-on: ${{ matrix.os }} |
| 103 | + |
| 104 | + steps: |
| 105 | + - name: Checkout |
| 106 | + uses: actions/checkout@v4 |
| 107 | + |
| 108 | + - name: Download PHPUnit logs |
| 109 | + uses: actions/download-artifact@v4 |
| 110 | + with: |
| 111 | + path: .Log |
| 112 | + pattern: phpunit-logs-${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }}-* |
| 113 | + merge-multiple: true |
| 114 | + |
| 115 | + - name: Store Composer cache directory |
| 116 | + id: composer-cache |
| 117 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 118 | + |
| 119 | + - uses: actions/cache/restore@v4 |
| 120 | + id: restore-composer-cache |
| 121 | + with: |
| 122 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 123 | + key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }} |
| 124 | + restore-keys: | |
| 125 | + ${{ runner.os }}-${{ matrix.php }}- |
| 126 | + ${{ runner.os }}- |
| 127 | +
|
| 128 | + - name: Set up PHP Version ${{ matrix.php }} |
| 129 | + uses: shivammathur/setup-php@v2 |
| 130 | + with: |
| 131 | + php-version: ${{ matrix.php }} |
| 132 | + coverage: xdebug |
| 133 | + tools: composer:v2 |
| 134 | + |
| 135 | + - name: Environment Check |
| 136 | + run: | |
| 137 | + php --version |
| 138 | + composer --version |
| 139 | +
|
| 140 | + - name: Validate composer.json |
| 141 | + run: composer validate |
| 142 | + |
| 143 | + - name: Composer install |
| 144 | + run: composer update --with "phpunit/php-code-coverage:^${{ matrix.coverage }}.0" --no-interaction |
| 145 | + |
| 146 | + - name: Save composer cache |
| 147 | + uses: actions/cache/save@v4 |
| 148 | + with: |
| 149 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 150 | + key: ${{ steps.restore-composer-cache.outputs.cache-primary-key }} |
| 151 | + |
| 152 | + - name: Merge log files |
| 153 | + run: bin/phpunit-merger log .Log/log/ .Log/junit.xml |
| 154 | + |
| 155 | + - name: Merge coverage files |
| 156 | + run: bin/phpunit-merger coverage .Log/coverage/ .Log/coverage.xml |
| 157 | + |
| 158 | + - name: Archive PHPUnit logs |
| 159 | + uses: actions/upload-artifact@v4 |
| 160 | + with: |
| 161 | + name: phpunit-logs-merged-${{ runner.os }}-${{ matrix.php }}-${{ matrix.coverage }} |
| 162 | + path: .Log/* |
| 163 | + retention-days: 1 |
0 commit comments