Laragear/Transbank

View on GitHub
.github/workflows/php.yml

Summary

Maintainability
Test Coverage
name: Tests

on:
  push:
  pull_request:

jobs:
  test:

    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        php: [ 8.0, 8.1 ]
        laravel: [ 9.* ]
        dependency-version: [ prefer-stable, prefer-lowest ]
        include:
          - laravel: 9.*
            testbench: 7.*

    name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }}

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: mbstring, intl
          coverage: xdebug

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ~/.composer/cache/files
          key: ${{ runner.os }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
          restore-keys: ${{ runner.os }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-

      - name: Install dependencies
        run: |
          composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-progress --no-update
          composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress
      - name: Run Tests
        run: composer run-script test

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v2