|
1 | 1 | name: build |
2 | 2 |
|
3 | | -on: [push, pull_request, workflow_dispatch] |
| 3 | +on: [ push, pull_request, workflow_dispatch ] |
4 | 4 |
|
5 | 5 | env: |
6 | 6 | DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader" |
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | phpunit: |
10 | | - name: PHP ${{ matrix.php }} on ${{ matrix.os }} |
| 10 | + name: PHP ${{ matrix.php }}-${{ matrix.os }} |
11 | 11 | runs-on: ${{ matrix.os }} |
12 | 12 | strategy: |
13 | 13 | fail-fast: false |
14 | 14 | matrix: |
15 | | - os: [ubuntu-latest] |
16 | | - php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] |
| 15 | + os: [ ubuntu-latest ] |
| 16 | + php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" ] |
17 | 17 |
|
18 | 18 | steps: |
19 | | - - name: Checkout |
20 | | - uses: actions/checkout@v2 |
21 | | - - name: Install PHP |
22 | | - uses: shivammathur/setup-php@v2 |
23 | | - with: |
24 | | - php-version: ${{ matrix.php }} |
25 | | - extensions: apc, curl, dom, intl, mbstring, mcrypt |
26 | | - ini-values: date.timezone='UTC' |
27 | | - - name: Get composer cache directory |
28 | | - id: composer-cache |
29 | | - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
30 | | - - name: Cache composer dependencies |
31 | | - uses: actions/cache@v4 |
32 | | - with: |
33 | | - path: ${{ steps.composer-cache.outputs.dir }} |
34 | | - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
35 | | - restore-keys: ${{ runner.os }}-composer- |
36 | | - - name: Install dependencies |
37 | | - run: composer update $DEFAULT_COMPOSER_FLAGS |
38 | | - - name: PHP Unit tests |
39 | | - run: vendor/bin/phpunit --verbose |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + - name: Install PHP |
| 22 | + uses: shivammathur/setup-php@v2 |
| 23 | + with: |
| 24 | + php-version: ${{ matrix.php }} |
| 25 | + extensions: apc, curl, dom, intl, mbstring, mcrypt |
| 26 | + ini-values: date.timezone='UTC' |
| 27 | + - name: Determine composer cache directory |
| 28 | + id: composer-cache |
| 29 | + run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV |
| 30 | + - name: Cache dependencies composer installed with composer |
| 31 | + uses: actions/cache@v4 |
| 32 | + with: |
| 33 | + path: ${{ env.COMPOSER_CACHE_DIR }} |
| 34 | + key: php${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} |
| 35 | + restore-keys: php${{ matrix.php }}-composer- |
| 36 | + - name: Update composer |
| 37 | + run: composer self-update |
| 38 | + - name: Install dependencies with composer |
| 39 | + run: composer update $DEFAULT_COMPOSER_FLAGS |
| 40 | + - name: Run unit tests |
| 41 | + run: vendor/bin/phpunit --verbose --colors=always |
0 commit comments