Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub ActionsでUnitテストが実行できるように修正 #100

Open
wants to merge 19 commits into
base: 3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: PHP Composer

on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '5.3', '5.4', '7.0', '7.1' ]
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: ${{ matrix.php }}
- 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

2 changes: 1 addition & 1 deletion src/Eccube/Form/Type/Admin/ProductType.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
* @param $form FormInterface
* @param $dirs array
*/
private function validateFilePath($form, $dirs)
public function validateFilePath($form, $dirs)
{
foreach ($form->getData() as $fileName) {
if (strpos($fileName, '..') !== false) {
Expand Down