Skip to content

Commit

Permalink
Merge pull request #383 from nanasess/fix-github-actions
Browse files Browse the repository at this point in the history
Github Actions が動作しなくなっていたのを修正
  • Loading branch information
okazy authored May 18, 2020
2 parents 38fdf8a + 74954d8 commit 62b62b0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 20 deletions.
64 changes: 44 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI/CD for EC-CUBE
on:
push:
branches:
- master
- '*'
tags:
- '*'
paths:
Expand All @@ -29,14 +29,23 @@ jobs:
- db: mysql
dbport: '3306'
dbuser: 'root'
dbpass: 'root'
dbpass: 'password'
dbname: 'eccube_db'
- db: pgsql
dbport: '5432'
dbuser: 'postgres'
dbpass: 'password'
dbname: 'eccube_db'
services:
mysql:
image: mysql:5.7
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:11
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
Expand All @@ -52,7 +61,7 @@ jobs:
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -79,7 +88,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
HTTP_URL: http://localhost:8085/
HTTPS_URL: http://localhost:8085/
Expand All @@ -90,14 +99,15 @@ jobs:
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
with:
chromedriver-version: '77.0.3865.40'
chromedriver-version: '2.43'

- name: Run to PHPUnit
run: |
data/vendor/bin/phpunit --exclude-group classloader
data/vendor/bin/phpunit --group classloader
sed 's|http://|https://|g' -i.bak data/config/config.php
data/vendor/bin/phpunit tests/class/SC_SessionFactoryTest.php
mv data/config/config.php.bak data/config/config.php
- name: Run chromedriver
run: |
Expand All @@ -112,7 +122,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
HTTP_URL: http://localhost:8085/
Expand All @@ -121,6 +131,10 @@ jobs:
php data/vendor/bin/codecept build
php -S 0.0.0.0:8085 -t html/ &
php data/vendor/bin/codecept run --env chrome --skip-group installer --steps
- name: Failure log
if: failure()
run: tail -n 300 data/logs/*

run-on-windows:
name: Run on Windows
runs-on: ${{ matrix.operating-system }}
Expand All @@ -131,7 +145,7 @@ jobs:
php: [ 5.5, 5.6, 7.1, 7.2, 7.3, 7.4 ]
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Composer install
uses: nanasess/composer-installer-action@master
Expand Down Expand Up @@ -165,17 +179,18 @@ jobs:
- name: Setup to database
run: |
choco install -y mysql --version 5.7.18
mysql --user=root -e "CREATE DATABASE `myapp_test`;"
mysql --user=root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';FLUSH PRIVILEGES;"
mysql --user=root -e "CREATE DATABASE eccube_db DEFAULT COLLATE=utf8_general_ci;"
mysql --user=root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;FLUSH PRIVILEGES;"
- name: Setup to EC-CUBE
env:
DB: mysql
USER: root
DBUSER: root
DBPASS: password
DBNAME: myapp_test
DBNAME: eccube_db
DBPORT: 3306
DBSERVER: 127.0.0.1
HTTP_URL: http://localhost:8085/
HTTPS_URL: http://localhost:8085/
run: bash eccube_install.sh mysql
Expand All @@ -195,20 +210,29 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-18.04 ]
php: [ 5.4, 5.5, 5.6, 7.1, 7.2, 7.3 ]
php: [ 5.4, 5.5, 5.6, 7.1, 7.2, 7.3, 7.4 ]
db: [ mysql, pgsql ]
include:
- db: mysql
dbport: '3306'
dbuser: 'root'
dbpass: 'root'
dbpass: 'password'
dbname: 'eccube_db'
- db: pgsql
dbport: '5432'
dbuser: 'postgres'
dbpass: 'password'
dbname: 'eccube_db'
services:
mysql:
image: mysql:5.7
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:11
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
Expand All @@ -224,7 +248,7 @@ jobs:
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -248,7 +272,7 @@ jobs:
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
with:
chromedriver-version: '77.0.3865.40'
chromedriver-version: '2.43'

- name: Run chromedriver
run: |
Expand All @@ -264,7 +288,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
run: mysql --user=${DBUSER} --password=${DBPASS} -h ${DBSERVER} -P ${DBPORT} -e "CREATE DATABASE ${DBNAME} DEFAULT COLLATE=utf8_general_ci;"
Expand All @@ -276,7 +300,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
run: |
Expand All @@ -290,7 +314,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
HTTP_URL: http://localhost:8085/
Expand All @@ -307,7 +331,7 @@ jobs:
steps:
- name: Checkout
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Get Composer Cache Directory
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
Expand Down
6 changes: 6 additions & 0 deletions ctests/acceptance/InstallerCept.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
$I->fillField('input[name=admin_dir]', $admindirectory);

$I->click('>> オプション設定');
$I->wait(1);
$I->selectOption('input[name=mail_backend]', 'smtp');
$I->fillField('input[name=smtp_host]', '127.0.0.1');
$I->fillField('input[name=smtp_port]', '1025');
Expand All @@ -44,6 +45,7 @@
defined('DB_PASSWORD') or define('DB_PASSWORD', getenv('DBPASS') );
defined('DB_PORT') or define('DB_PORT', getenv('DBPORT'));
defined('DB_SERVER') or define('DB_SERVER', getenv('DBSERVER'));
$I->wait(1);

$I->selectOption('select[name=db_type]', DB_TYPE);
$I->fillField('input[name=db_server]', DB_SERVER);
Expand All @@ -52,6 +54,7 @@
$I->fillField('input[name=db_user]', DB_USER);
$I->fillField('input[name=db_password]', DB_PASSWORD);
$I->click('次へ進む');
$I->wait(1);

$I->expect('STEP3');
$I->see('データベースの初期化');
Expand All @@ -63,14 +66,17 @@
$I->waitForText('○:シーケンスの作成に成功しました。', 60);
$I->click('次へ進む');

$I->wait(1);
$I->expect('STEP4');
$I->see('サイト情報について');
$I->click('次へ進む');

$I->wait(1);
$I->see('インストールが完了しました。');
$I->seeInDatabase('dtb_member', ['login_id' => $user]);
$I->click('管理画面へログインする');

$I->wait(1);
$I->seeInCurrentUrl('/'.$admindirectory);
$I->fillField('input[name=login_id]', $user);
$I->fillField('input[name=password]', $password);
Expand Down

0 comments on commit 62b62b0

Please sign in to comment.