matrixの追加 #15
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 Composer | |
on: | |
push: | |
branches: [ '**' ] | |
pull_request: | |
branches: [ '**' ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
db: [ mysql, pgsql ] | |
include: | |
- db: mysql | |
database_url: mysql://root:[email protected]:3306/eccube_db | |
- db: pgsql | |
database_url: postgres://postgres:[email protected]:5432/eccube_db | |
services: | |
mysql: | |
image: mysql:5.5 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
postgres: | |
image: postgres:9 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.0 | |
- name: Setup Composer | |
run: | | |
composer self-update --1 | |
composer install | |
- name: Setup EC-CUBE | |
run: | | |
php eccube_install.php $DB none #26行目でcomposerインストールしているためスキップ | |
env: | |
DB: ${{ matrix.db }} | |
DATABASE_URL: ${{ matrix.database_url }} | |
- name: Php Unit Test | |
run: | | |
vendor/bin/phpunit | |