Skip to content

some refactoring for Maintainability #73

some refactoring for Maintainability

some refactoring for Maintainability #73

Workflow file for this run

name: CI
on:
push:
branches: [ develop, dev-*, master ]
pull_request:
branches: [ develop, dev-*, master ]
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
laravel: [ 10, 11 ]
php: [ 8.2, 8.3, 8.4 ]
include:
# Laravel 11: PHP 8.2–8.4
- laravel: 11
php: 8.2
- laravel: 11
php: 8.3
- laravel: 11
php: 8.4
exclude:
- laravel: 10
php: 8.4
- laravel: 11
php: 8.1
mysql: [ 5.7 ]
services:
mysql:
image: mysql:${{ matrix.mysql }}
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: testing
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3
name: Laravel ${{ matrix.laravel }} / PHP ${{ matrix.php }} / MySQL ${{ matrix.mysql }}
env:
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_DATABASE: testing
DB_USERNAME: root
DB_PASSWORD: ''
steps:
- uses: actions/checkout@v4
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: >
mbstring,
pdo_mysql,
zip,
exif,
intl,
gd,
bcmath,
curl,
dom,
xdebug
coverage: xdebug
- name: Debug info
run: |
php -v
composer --version
mysql --version || true
- name: Wait for MySQL
run: |
echo "Waiting for MySQL..."
for i in {30..0}; do
if mysqladmin ping -h 127.0.0.1 --silent; then
echo "MySQL is ready"
break
fi
echo "Waiting for MySQL ($i)..."
sleep 1
done
- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist --no-progress
- name: Prepare Code Climate Reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Run Tests
run: vendor/bin/phpunit --coverage-clover=clover.xml --path-coverage
- name: Send coverage to Code Climate
if: env.CC_TEST_REPORTER_ID != ''
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: ./cc-test-reporter after-build -t clover -p clover.xml --exit-code 0