From 67e9e34bd2c656ebdb40ac701550473786d388eb Mon Sep 17 00:00:00 2001 From: Daniel Mason Date: Sat, 2 May 2020 03:20:24 +0100 Subject: [PATCH 1/2] Add PHP Matrix and caching Its common to do a matrix for supported PHP versions and to cache composer dependencies for faster runs. --- .github/workflows/laravel.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 203c13c..485485e 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -11,23 +11,48 @@ jobs: runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.3, 7.4] + + name: PHP ${{ matrix.php }} + steps: - uses: actions/checkout@v2 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP ${{ matrix.php }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd + coverage: none + - uses: zhulik/redis-action@1.1.0 with: redis version: '5' - number of databases: 100 + number of databases: 100 + - uses: harmon758/postgresql-action@v1 with: postgresql version: '11' postgresql db: 'testing' postgresql user: 'homestead' postgresql password: 'secret' + - name: Copy .env run: php -r "file_exists('.env') || copy('.env.example', '.env');" + - name: Install Dependencies run: | composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}" composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist + - name: Execute tests (Unit and Feature tests) via PHPUnit run: vendor/bin/phpunit --configuration phpunit.xml.dist From 0a9cf23b41e712bd858962bb5b2962994fccf203 Mon Sep 17 00:00:00 2001 From: Daniel Mason Date: Sat, 2 May 2020 03:27:12 +0100 Subject: [PATCH 2/2] Add pgsql --- .github/workflows/laravel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 485485e..bc2df55 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -31,7 +31,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, pgsql, pdo_pgsql coverage: none - uses: zhulik/redis-action@1.1.0