Support CakePHP 5.x #84
Workflow file for this run
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 Workflow | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: | |
- 8.1 | |
- 8.2 | |
- 8.3 | |
dsn: | |
- '' | |
- mysql://lampager_test:[email protected]/lampager_test | |
- postgres://lampager_test:lampager_test@localhost/lampager_test | |
services: | |
mysql: | |
image: mysql:8.0 | |
ports: | |
- '3306:3306' | |
env: | |
MYSQL_DATABASE: lampager_test | |
MYSQL_USER: lampager_test | |
MYSQL_PASSWORD: lampager_test | |
MYSQL_ROOT_PASSWORD: lampager_test | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=30s | |
--health-retries=5 | |
postgres: | |
image: postgres:15.2 | |
ports: | |
- '5432:5432' | |
env: | |
POSTGRES_DB: lampager_test | |
POSTGRES_USER: lampager_test | |
POSTGRES_PASSWORD: lampager_test | |
options: >- | |
--health-cmd=pg_isready | |
--health-interval=10s | |
--health-timeout=30s | |
--health-retries=5 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Cache composer | |
uses: actions/cache@v3 | |
with: | |
path: .composer/cache | |
key: buildx-${{ github.sha }} | |
restore-keys: composer- | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: pcov | |
- name: Set up MySQL | |
run: | | |
mysql \ | |
--host=127.0.0.1 \ | |
--user=root \ | |
--password=lampager_test <<< " | |
ALTER USER 'lampager_test'@'%' IDENTIFIED WITH mysql_native_password BY 'lampager_test'; | |
" | |
- name: Install dependencies | |
run: | | |
composer install | |
mkdir -p build/logs | |
- name: Test | |
env: | |
DB_DSN: ${{ matrix.dsn }} | |
run: | | |
composer test | |
- name: Coverage | |
if: ${{ matrix.php == 8.3 && matrix.dsn == '' }} | |
env: | |
COVERALLS_REPO_TOKEN: ${{ github.token }} | |
run: | | |
export PATH=$(composer config --global home):$PATH | |
composer global require 'php-coveralls/php-coveralls:*' | |
php-coveralls --verbose |