Skip to content

chore(deps): bump stefanzweifel/git-auto-commit-action from 4 to 5 #719

chore(deps): bump stefanzweifel/git-auto-commit-action from 4 to 5

chore(deps): bump stefanzweifel/git-auto-commit-action from 4 to 5 #719

Workflow file for this run

name: Run tests
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
php: [8.1, 8.2]
laravel: [10.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
name: Unit tests - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Composer packages
uses: actions/cache@v3
with:
path: vendor
key: php-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: pcov
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update --ignore-platform-reqs
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: |
mkdir build
composer test
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
if: ${{ matrix.os != 'ubuntu-latest' || matrix.php != 8.1 || matrix.stability != 'prefer-stable' }}
- name: Execute tests with code coverage
run: |
composer test-coverage
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
if: ${{ matrix.os == 'ubuntu-latest' && matrix.php == 8.1 && matrix.stability == 'prefer-stable' }}
- name: Save code coverage to artifact
uses: actions/upload-artifact@v3
if: matrix.php == 8.1
with:
name: code-coverage
path: "coverage.xml"
retention-days: 5
upload-coverage:
runs-on: ubuntu-latest
needs:
- test
steps:
- uses: actions/checkout@v4
- name: Fetch code coverage artifact
uses: actions/download-artifact@v3
with:
name: code-coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true