|
4 | 4 | pull_request: |
5 | 5 | branches: |
6 | 6 | - "master" |
7 | | - workflow_dispatch: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.head_ref || github.run_id }} |
| 10 | + cancel-in-progress: true |
8 | 11 |
|
9 | 12 | jobs: |
| 13 | + validate-mergable: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - name: "Checkout" |
| 17 | + uses: actions/checkout@v3 |
| 18 | + with: |
| 19 | + fetch-depth: 0 |
| 20 | + |
| 21 | + - name: "Validate Mergable" |
| 22 | + run: git merge origin/master --no-commit --ff-only |
| 23 | + |
10 | 24 | render-php: |
| 25 | + needs: validate-mergable |
11 | 26 | runs-on: ${{ matrix.operating-system }} |
| 27 | + |
12 | 28 | strategy: |
13 | 29 | max-parallel: 3 |
14 | | - fail-fast: false |
| 30 | + fail-fast: true |
15 | 31 | matrix: |
16 | 32 | operating-system: ["ubuntu-latest", "windows-latest"] |
17 | | - php-versions: ["7.0", "7.1", "7.4", "8.0", "8.1"] |
| 33 | + php-versions: ["8.0", "8.1", "8.2"] |
18 | 34 | phpunit-versions: ["latest"] |
| 35 | + |
19 | 36 | steps: |
20 | | - - uses: actions/checkout@v3 |
| 37 | + - name: "Checkout" |
| 38 | + uses: actions/checkout@v3 |
21 | 39 | with: |
22 | 40 | fetch-depth: 0 |
23 | | - - run: git merge origin/master --no-commit --ff-only |
24 | | - - uses: shivammathur/setup-php@v2 |
| 41 | + |
| 42 | + - name: "Setup PHP" |
| 43 | + uses: shivammathur/setup-php@v2 |
25 | 44 | with: |
26 | 45 | php-version: ${{ matrix.php-versions }} |
27 | 46 | extensions: mbstring, intl |
28 | 47 | ini-values: post_max_size=256M, max_execution_time=180 |
29 | | - coverage: xdebug |
| 48 | + coverage: none |
30 | 49 | tools: phpunit:${{ matrix.phpunit-versions }} |
31 | | - - name: "Install" |
32 | | - run: | |
33 | | - composer update --no-install --with-all-dependencies |
34 | | - composer install |
35 | | - - name: "PHPUnit Tests" |
36 | | - run: ./vendor/bin/phpunit |
| 50 | + |
| 51 | + - name: "Composer State" |
| 52 | + run: composer update --no-install --with-all-dependencies |
| 53 | + |
| 54 | + - name: "Composer Name Hash" |
| 55 | + id: composer-hash |
| 56 | + uses: KEINOS/gh-action-hash-for-cache@main |
| 57 | + with: |
| 58 | + path: ./composer.lock |
| 59 | + |
| 60 | + - name: "Caching" |
| 61 | + id: cache-composer |
| 62 | + uses: actions/cache@v3 |
| 63 | + with: |
| 64 | + path: vendor |
| 65 | + key: composer-${{ steps.composer-hash.outputs.hash }} |
| 66 | + restore-keys: composer-${{ steps.composer-hash.outputs.hash }} |
| 67 | + |
| 68 | + - name: "Install Dependencies" |
| 69 | + if: ${{ steps.cache-composer.outputs.cache-hit != 'true' }} |
| 70 | + run: composer install |
| 71 | + |
| 72 | + - name: "Linux: Restore Vendor Executable" |
| 73 | + if: matrix.operating-system == 'ubuntu-latest' |
| 74 | + run: chmod -R 0755 vendor |
| 75 | + |
| 76 | + - name: "PHPUnit" |
| 77 | + run: ./vendor/bin/phpunit --testdox |
0 commit comments