Skip to content

changed CI config.

changed CI config. #17

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
strategy:
matrix:
php: [7.2, 7.3, 7.4, 8.0 ]
mysql: [5.7, 8.0]
include:
- composer_option: --ignore-platform-reqs
exclude:
- php: 8.0 # incompatible
services:
mysql:
image: mysql:${{ matrix.mysql }}
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 }})
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
coverage: xdebug
- name: Debug info
run: |
php -v
composer --version
mysql --version || true
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 ${{ matrix.composer_option || '' }}
- 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=coverage.xml
- name: Send coverage to Code Climate
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: ./cc-test-reporter after-build -t clover --exit-code $?