Fix host in workflow #80
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: PHP Tests | |
on: | |
push: | |
branches: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ['7.4', '8.3'] | |
composer-type: [stable, dev] | |
name: PHP ${{ matrix.php-version }} & ${{ matrix.db-type }} & ${{ matrix.composer-type }} | |
services: | |
postgres: | |
image: postgres | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_DB: db | |
POSTGRES_PASSWORD: db | |
POSTGRES_USER: db | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_HOST: db | |
MYSQL_USER: db | |
MYSQL_PASSWORD: db | |
MYSQL_DATABASE: db | |
MYSQL_ROOT_PASSWORD: db | |
ports: | |
# Opens port 3306 on service container and host | |
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers | |
- 3306:3306 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: mbstring, intl, apcu, pdo_sqlite, pdo_mysql, pdo_pgsql | |
ini-values: apc.enable_cli = 1 | |
- name: Update composer | |
run: composer self-update | |
- name: Validate composer.json | |
run: composer validate | |
- name: Install dependencies | |
run: | | |
if [[ ${{ matrix.composer-type }} == 'stable' ]]; then | |
composer update --prefer-dist --no-progress --no-suggest --prefer-stable | |
else | |
composer update --prefer-dist --no-progress --no-suggest | |
fi | |
- name: Run Sqlite tests | |
run: composer sqlite | |
- name: Run Mysql tests | |
run: composer mysql | |
- name: Run Postgres tests | |
run: composer pgsql |