From 7b05117a39e65e4a75748356c385c5bd47fb208b Mon Sep 17 00:00:00 2001 From: Nathan E Date: Mon, 31 Aug 2020 21:42:17 -0400 Subject: [PATCH 1/2] Update build action - Added laravel 8 test matrix - Update actions/cache@v2 --- .github/workflows/build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4edd15fb..c7e3605a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: matrix: php-version: [7.2, 7.3, 7.4] - laravel-version: [6, 7] + laravel-version: [6, 7, 8] os: [ubuntu-latest] @@ -58,12 +58,16 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Determine composer cache directory + id: determine-composer-cache-directory + run: 'echo "::set-output name=directory::$(composer config cache-dir)"' + - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: - path: ~/.composer/cache/files + path: ${{ steps.determine-composer-cache-directory.outputs.directory }} key: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }} + restore-keys: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }}-composer- - name: Setup PHP uses: shivammathur/setup-php@v2 From 86e77e57c07f9d9729ba612e7dfe5ab454c1a969 Mon Sep 17 00:00:00 2001 From: Nathan E Date: Wed, 9 Sep 2020 22:59:40 -0400 Subject: [PATCH 2/2] chore: various improvements - Handle composer timeouts - Setup problem matchers for PHP & PHPUnit This will scan the logs for PHP & PHPUnit errors and warnings, and surface them prominently in the GitHub Actions UI by creating annotations and log file decorations. --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7e3605a..c6000746 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,20 +77,42 @@ jobs: coverage: none ini-values: "memory_limit=-1" + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Install highest dependencies from composer.json if: matrix.dependencies == 'highest' - run: composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }} + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }} - name: Install lowest dependencies from composer.json if: matrix.dependencies == 'lowest' - run: composer install ${{ env.COMPOSER_FLAGS }} --prefer-lowest + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer install ${{ env.COMPOSER_FLAGS }} --prefer-lowest - name: Install dependencies from composer.lock if: matrix.dependencies == 'locked' - run: composer install ${{ env.COMPOSER_FLAGS }} + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer install ${{ env.COMPOSER_FLAGS }} - name: Select Laravel version - run: composer require "laravel/framework:${{ matrix.laravel-version }}.*" --no-update + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require "laravel/framework:${{ matrix.laravel-version }}.*" --no-update - name: Run tests run: vendor/bin/phpunit --verbose