mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-12 02:55:13 +00:00
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
name: CI Code Checks
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
run:
|
|
runs-on: ubuntu-18.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php-version: ['8.0', '8.1']
|
|
laravel-version: ['^6.0', '^7.0', '^8.0', '^9.0']
|
|
exclude:
|
|
- laravel-version: '^6.0'
|
|
php-version: '8.1'
|
|
- laravel-version: '^7.0'
|
|
php-version: '8.1'
|
|
name: PHP ${{ matrix.php-version }} - Laravel ${{ matrix.laravel-version }}
|
|
env:
|
|
PHP_VERSION: ${{ matrix.php-versions }}
|
|
steps:
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-version }}
|
|
extensions: bcmath,gmp,intl
|
|
env:
|
|
runner: ubuntu-18.04
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Use appropiate Laravel version in composer.json (without installing)
|
|
run: |
|
|
composer require --no-update --no-interaction "laravel/framework:${{ matrix.laravel-version }}"
|
|
composer validate
|
|
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.composer/cache/files
|
|
key: dependencies-laravel-${{ matrix.laravel-version }}-php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}
|
|
|
|
- name: Install composer packages
|
|
run: composer install --prefer-dist --no-interaction
|
|
|
|
- name: Tests Coverage
|
|
run: vendor/bin/phpunit --coverage-clover=coverage.xml
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v1
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
env_vars: PHP_VERSION
|
|
fail_ci_if_error: true
|