Skip to content

Commit 67e9e34

Browse files
authored
Add PHP Matrix and caching
Its common to do a matrix for supported PHP versions and to cache composer dependencies for faster runs.
1 parent 7a38724 commit 67e9e34

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/laravel.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,48 @@ jobs:
1111

1212
runs-on: ubuntu-latest
1313

14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
php: [7.3, 7.4]
18+
19+
name: PHP ${{ matrix.php }}
20+
1421
steps:
1522
- uses: actions/checkout@v2
23+
24+
- name: Cache dependencies
25+
uses: actions/cache@v1
26+
with:
27+
path: ~/.composer/cache/files
28+
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
29+
30+
- name: Setup PHP ${{ matrix.php }}
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
35+
coverage: none
36+
1637
- uses: zhulik/[email protected]
1738
with:
1839
redis version: '5'
19-
number of databases: 100
40+
number of databases: 100
41+
2042
- uses: harmon758/postgresql-action@v1
2143
with:
2244
postgresql version: '11'
2345
postgresql db: 'testing'
2446
postgresql user: 'homestead'
2547
postgresql password: 'secret'
48+
2649
- name: Copy .env
2750
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
51+
2852
- name: Install Dependencies
2953
run: |
3054
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}"
3155
composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
56+
3257
- name: Execute tests (Unit and Feature tests) via PHPUnit
3358
run: vendor/bin/phpunit --configuration phpunit.xml.dist

0 commit comments

Comments
 (0)