|
| 1 | +name: "(Test): PHPUnit" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [labeled, synchronize, opened, reopened] |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - 'core' |
| 9 | + - 'pro' |
| 10 | + paths-ignore: |
| 11 | + - '**.md' |
| 12 | + - '**.txt' |
| 13 | + - '.gitignore' |
| 14 | + - 'docs/**' |
| 15 | + workflow_dispatch: |
| 16 | + |
| 17 | +permissions: |
| 18 | + contents: read |
| 19 | + pull-requests: read |
| 20 | + actions: read |
| 21 | + |
| 22 | +concurrency: |
| 23 | + group: phpunit-${{ github.event_name }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }} |
| 24 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 25 | + |
| 26 | +jobs: |
| 27 | + phpunit-php-7-4: |
| 28 | + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests') |
| 29 | + uses: ./.github/workflows/phpunit-test.yml |
| 30 | + with: |
| 31 | + php-version: '7.4' |
| 32 | + |
| 33 | + phpunit-php-8-0: |
| 34 | + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests') |
| 35 | + uses: ./.github/workflows/phpunit-test.yml |
| 36 | + with: |
| 37 | + php-version: '8.0' |
| 38 | + |
| 39 | + phpunit-php-8-1: |
| 40 | + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests') |
| 41 | + uses: ./.github/workflows/phpunit-test.yml |
| 42 | + with: |
| 43 | + php-version: '8.1' |
| 44 | + |
| 45 | + phpunit-php-8-2: |
| 46 | + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests') |
| 47 | + uses: ./.github/workflows/phpunit-test.yml |
| 48 | + with: |
| 49 | + php-version: '8.2' |
| 50 | + |
| 51 | + phpunit-php-8-3: |
| 52 | + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests') |
| 53 | + uses: ./.github/workflows/phpunit-test.yml |
| 54 | + with: |
| 55 | + php-version: '8.3' |
| 56 | + |
| 57 | + phpunit-php-8-4: |
| 58 | + if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-tests') |
| 59 | + uses: ./.github/workflows/phpunit-test.yml |
| 60 | + with: |
| 61 | + php-version: '8.4' |
| 62 | + |
| 63 | + test-result: |
| 64 | + needs: [phpunit-php-7-4, phpunit-php-8-0, phpunit-php-8-1, phpunit-php-8-2, phpunit-php-8-3, phpunit-php-8-4] |
| 65 | + if: always() && (needs.phpunit-php-7-4.result != 'skipped' || needs.phpunit-php-8-0.result != 'skipped' || needs.phpunit-php-8-1.result != 'skipped' || needs.phpunit-php-8-2.result != 'skipped' || needs.phpunit-php-8-3.result != 'skipped' || needs.phpunit-php-8-4.result != 'skipped') |
| 66 | + runs-on: ubuntu-22.04 |
| 67 | + name: PHPUnit - Test Results Summary |
| 68 | + steps: |
| 69 | + - name: Test status summary |
| 70 | + run: | |
| 71 | + echo "PHP 7.4: ${{ needs.phpunit-php-7-4.result }}" |
| 72 | + echo "PHP 8.0: ${{ needs.phpunit-php-8-0.result }}" |
| 73 | + echo "PHP 8.1: ${{ needs.phpunit-php-8-1.result }}" |
| 74 | + echo "PHP 8.2: ${{ needs.phpunit-php-8-2.result }}" |
| 75 | + echo "PHP 8.3: ${{ needs.phpunit-php-8-3.result }}" |
| 76 | + echo "PHP 8.4: ${{ needs.phpunit-php-8-4.result }}" |
| 77 | +
|
| 78 | + - name: Check overall status |
| 79 | + if: | |
| 80 | + (needs.phpunit-php-7-4.result != 'success' && needs.phpunit-php-7-4.result != 'skipped') || |
| 81 | + (needs.phpunit-php-8-0.result != 'success' && needs.phpunit-php-8-0.result != 'skipped') || |
| 82 | + (needs.phpunit-php-8-1.result != 'success' && needs.phpunit-php-8-1.result != 'skipped') || |
| 83 | + (needs.phpunit-php-8-2.result != 'success' && needs.phpunit-php-8-2.result != 'skipped') || |
| 84 | + (needs.phpunit-php-8-3.result != 'success' && needs.phpunit-php-8-3.result != 'skipped') || |
| 85 | + (needs.phpunit-php-8-4.result != 'success' && needs.phpunit-php-8-4.result != 'skipped') |
| 86 | + run: exit 1 |
| 87 | + |
0 commit comments