This repository has been archived by the owner on Nov 21, 2023. It is now read-only.
Update README.md #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:8.0 | |
ports: | |
- '3306:3306' | |
env: | |
MYSQL_DATABASE: testing | |
MYSQL_USER: testing | |
MYSQL_PASSWORD: testing | |
MYSQL_ROOT_PASSWORD: testing | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=30s | |
--health-retries=5 | |
postgres: | |
image: postgres:15 | |
ports: | |
- '5432:5432' | |
env: | |
POSTGRES_DB: testing | |
POSTGRES_USER: testing | |
POSTGRES_PASSWORD: testing | |
options: >- | |
--health-cmd=pg_isready | |
--health-interval=10s | |
--health-timeout=30s | |
--health-retries=5 | |
sqlsrv: | |
image: mcr.microsoft.com/mssql/server:2019-latest | |
ports: | |
- '1433:1433' | |
env: | |
ACCEPT_EULA: Y | |
SA_PASSWORD: Password! | |
options: >- | |
--name sqlsrv | |
--health-cmd "echo quit | /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -l 1 -U sa -P Password!" | |
strategy: | |
matrix: | |
php: [8.1, '8.0'] | |
laravel: [^10.20, 10.19.*, ^9.0] | |
db: [mysql, pgsql, sqlite, sqlsrv, 'odbc:sqlsrv'] | |
exclude: | |
- { php: 8.0, laravel: ^10.20 } | |
- { php: 8.0, laravel: 10.19.* } | |
- { php: 8.0, laravel: ^11.0 } | |
- { php: 8.1, laravel: ^11.0 } | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: xdebug | |
- name: Set up SQLServer | |
if: matrix.db == 'sqlsrv' || matrix.db == 'odbc:sqlsrv' | |
run: | | |
docker exec sqlsrv \ | |
/opt/mssql-tools/bin/sqlcmd \ | |
-S 127.0.0.1 \ | |
-U sa \ | |
-P Password! \ | |
-Q "create database [testing]" | |
- name: Adjust Package Versions | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" --dev --no-update | |
composer update | |
- name: Prepare Database Config | |
run: mv tests/config/database.github.php tests/config/database.php | |
- name: Prepare Coverage Directory | |
run: mkdir -p build/logs | |
- name: Test | |
run: | | |
composer test -- --migrate-configuration || : | |
composer test -- --coverage-clover build/logs/clover.xml | |
env: | |
DB: ${{ matrix.db }} | |
- name: Upload Coverage | |
uses: nick-invision/retry@v2 | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_PARALLEL: 'true' | |
COVERALLS_FLAG_NAME: "db:${{ matrix.db }} laravel:${{ matrix.laravel }} php:${{ matrix.php }}" | |
with: | |
timeout_minutes: 1 | |
max_attempts: 3 | |
command: | | |
composer global require php-coveralls/php-coveralls | |
php-coveralls --coverage_clover=build/logs/clover.xml -v | |
coverage-aggregation: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Aggregate Coverage | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true |