Skip to content

脆弱性対応(4.0) #281

脆弱性対応(4.0)

脆弱性対応(4.0) #281

Workflow file for this run

name: CI/CD for EC-CUBE
on:
push:
branches:
- 4.0
tags:
- '*'
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'
release:
types: [ published ]
jobs:
phpunit:
name: PHPUnit
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-22.04 ]
php: [ 7.4 ]
db: [ mysql, pgsql, sqlite3 ]
include:
- db: mysql
database_url: mysql://root:password@127.0.0.1:3306/eccube_db
database_server_version: 5
- db: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 11
- db: sqlite3
database_url: sqlite:///var/eccube.db
database_server_version: 3
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
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:
- name: Checkout
uses: actions/checkout@master
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: composer install
run: |
curl -O https://getcomposer.org/download/latest-1.x/composer.phar
php composer.phar install --dev --no-interaction -o --apcu-autoloader
- name: Setup EC-CUBE
env:
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
bin/console doctrine:database:create
bin/console doctrine:schema:create
bin/console eccube:fixtures:load
- name: PHPUnit
env:
APP_ENV: 'test'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
run: |
bin/phpunit --exclude-group cache-clear,cache-clear-install,update-schema-doctrine
bin/phpunit --group cache-clear
bin/phpunit --group cache-clear-install
bin/phpunit --group update-schema-doctrine --exclude-group update-schema-doctrine-install
bin/phpunit --group update-schema-doctrine-install --filter=testInstallPluginWithNoProxy
bin/phpunit --group update-schema-doctrine-install --filter=testInstallPluginWithProxy
bin/phpunit --group update-schema-doctrine-install --filter=testEnablePluginWithNoProxy
bin/phpunit --group update-schema-doctrine-install --filter=testEnablePluginWithProxy
bin/phpunit --group update-schema-doctrine-install --filter=testDisablePluginWithNoProxy
bin/phpunit --group update-schema-doctrine-install --filter=testDisablePluginWithProxy
bin/phpunit --group update-schema-doctrine-install --filter=testCreateEntityAndTrait
codeception:
name: Codeception
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-22.04 ]
php: [ 7.4 ]
db: [ pgsql ]
group: [ admin01, admin02, admin03, front, installer ]
include:
- db: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 11
- group: admin01
app_env: 'codeception'
- group: admin02
app_env: 'codeception'
- group: admin03
app_env: 'codeception'
- group: front
app_env: 'codeception'
- group: installer
app_env: 'install'
services:
postgres:
image: postgres:11
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
mailcatcher:
image: schickling/mailcatcher
ports:
- 1080:1080
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: composer install
run: |
sudo composer selfupdate --1
composer install --dev --no-interaction -o --apcu-autoloader
- name: Setup to EC-CUBE
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
echo "APP_ENV=${APP_ENV}" > .env
bin/console doctrine:database:create --env=dev
bin/console doctrine:schema:create --env=dev
bin/console eccube:fixtures:load --env=dev
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
- name: Install fonts
run: sudo apt install fonts-ipafont fonts-ipaexfont
- name: Run chromedriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
echo ">>> Started chrome-driver"
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
- name: Start PHP Development Server
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
run: php -S localhost:8000 &
- name: Codeception
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
GROUP: ${{ matrix.group }}
SYMFONY_DEPRECATIONS_HELPER: weak
run: |
composer config platform.php 7.4.30
composer require --dev captbaritone/mailcatcher-codeception-module:"^2.4" --no-plugins --no-scripts
vendor/bin/codecept -vvv run acceptance --env chrome,github_action -g ${GROUP}
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v2
with:
name: codeception-${{ matrix.group }}-evidence
path: codeception/_output/
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: codeception-${{ matrix.group }}-logs
path: var/log/
plugin-install:
name: Plugin install
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-22.04 ]
php: [ 7.4 ]
db: [ pgsql, mysql ]
method:
- test_install_enable_disable_remove_store
- test_install_enable_disable_remove_local
- test_install_enable_disable_enable_disable_remove_store
- test_install_enable_disable_enable_disable_remove_local
- test_install_remove_local
- test_install_remove_store
- test_bundle_install_enable_disable_remove_store
- test_bundle_install_update_enable_disable_remove_store
include:
- db: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 11
- db: mysql
database_url: mysql://root:password@127.0.0.1:3306/eccube_db
database_server_version: 5
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
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
mailcatcher:
image: schickling/mailcatcher
ports:
- 1080:1080
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: composer install
run: |
sudo composer selfupdate --1
composer install --dev --no-interaction -o --apcu-autoloader
- name: Setup to EC-CUBE
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
echo "APP_ENV=${APP_ENV}" > .env
bin/console doctrine:database:create --env=dev
bin/console doctrine:schema:create --env=dev
bin/console eccube:fixtures:load --env=dev
- name: Update baseinfo with pgsql
if: matrix.db == 'pgsql'
env:
PGPASSWORD: 'password'
run: |
sudo apt-fast install -y postgresql-client
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test';"
- name: Update baseinfo with mysql
if: matrix.db == 'mysql'
run: mysql -h 127.0.0.1 -u root -ppassword eccube_db -e "update dtb_base_info set authentication_key='test';"
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
- name: Run chromedriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
echo ">>> Started chrome-driver"
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
- name: Start PHP Development Server
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
run: php -S localhost:8000 &
## ${PWD}/repos does not exist so service cannot be started
- name: Run package-api
run: |
if [[ ! -d ${PWD}/repos ]]; then mkdir -p ${PWD}/repos ; fi
docker run -d --rm -v ${PWD}/repos:/repos -e MOCK_REPO_DIR=/repos -p 8080:8080 eccube/mock-package-api
- name: Codeception
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
METHOD: ${{ matrix.method }}
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
NO_FIXTURES: 1
run: vendor/bin/codecept -vvv run acceptance --env chrome,github_action EA10PluginCest:${METHOD}
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v2
with:
name: plugin-install-${{ matrix.method }}-evidence
path: codeception/_output/
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: plugin-install-${{ matrix.method }}-logs
path: var/log/
plugin-update:
name: Plugin Update
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-22.04 ]
php: [ 7.4 ]
db: [ pgsql, mysql ]
method:
- test_install_update_remove_store
- test_install_update_remove_local
- test_install_enable_disable_update_enable_disable_remove_local
- test_install_enable_disable_update_enable_disable_remove_store
- test_install_enable_update_disable_remove_store
- test_install_enable_update_disable_remove_local
include:
- db: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 11
- db: mysql
database_url: mysql://root:password@127.0.0.1:3306/eccube_db
database_server_version: 5
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
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
mailcatcher:
image: schickling/mailcatcher
ports:
- 1080:1080
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: Install to Composer
run: |
sudo composer selfupdate --1
composer install --dev --no-interaction -o --apcu-autoloader
- name: Setup to EC-CUBE
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
echo "APP_ENV=${APP_ENV}" > .env
bin/console doctrine:database:create --env=dev
bin/console doctrine:schema:create --env=dev
bin/console eccube:fixtures:load --env=dev
- name: Update baseinfo with pgsql
if: matrix.db == 'pgsql'
env:
PGPASSWORD: 'password'
run: |
sudo apt-fast install -y postgresql-client
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test';"
- name: Update baseinfo with mysql
if: matrix.db == 'mysql'
run: mysql -h 127.0.0.1 -u root -ppassword eccube_db -e "update dtb_base_info set authentication_key='test';"
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
- name: Run chromedriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
echo ">>> Started chrome-driver"
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
- name: Start PHP Development Server
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
run: php -S localhost:8000 &
## ${PWD}/repos does not exist so service cannot be started
- name: Run package-api
run: |
if [[ ! -d ${PWD}/repos ]]; then mkdir -p ${PWD}/repos ; fi
docker run -d --rm -v ${PWD}/repos:/repos -e MOCK_REPO_DIR=/repos -p 8080:8080 eccube/mock-package-api
- name: Run to Codeception
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
METHOD: ${{ matrix.method }}
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
NO_FIXTURES: 1
run: vendor/bin/codecept -vvv run acceptance --env chrome,github_action EA10PluginCest:${METHOD}
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v2
with:
name: plugin-update-${{ matrix.method }}-evidence
path: codeception/_output/
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: plugin-update-${{ matrix.method }}-logs
path: var/log/
plugin-extend:
name: Plugin extend
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-22.04 ]
php: [ 7.4 ]
db: [ pgsql, mysql ]
method:
- test_extend_same_table_store
- test_extend_same_table_disabled_remove_store
- test_extend_same_table_local
- test_extend_same_table_disabled_remove_local
- test_extend_same_table_crossed_store
- test_extend_same_table_crossed_local
include:
- db: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 11
- db: mysql
database_url: mysql://root:password@127.0.0.1:3306/eccube_db
database_server_version: 5
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
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
mailcatcher:
image: schickling/mailcatcher
ports:
- 1080:1080
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: Install to Composer
run: |
sudo composer selfupdate --1
composer install --dev --no-interaction -o --apcu-autoloader
- name: Setup to EC-CUBE
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
echo "APP_ENV=${APP_ENV}" > .env
bin/console doctrine:database:create --env=dev
bin/console doctrine:schema:create --env=dev
bin/console eccube:fixtures:load --env=dev
- name: Update baseinfo with pgsql
if: matrix.db == 'pgsql'
env:
PGPASSWORD: 'password'
run: |
sudo apt-fast install -y postgresql-client
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test';"
- name: Update baseinfo with mysql
if: matrix.db == 'mysql'
run: mysql -h 127.0.0.1 -u root -ppassword eccube_db -e "update dtb_base_info set authentication_key='test';"
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
- name: Run chromedriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
echo ">>> Started chrome-driver"
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
- name: Start PHP Development Server
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
run: php -S localhost:8000 &
## ${PWD}/repos does not exist so service cannot be started
- name: Run package-api
run: |
if [[ ! -d ${PWD}/repos ]]; then mkdir -p ${PWD}/repos ; fi
docker run -d --rm -v ${PWD}/repos:/repos -e MOCK_REPO_DIR=/repos -p 8080:8080 eccube/mock-package-api
- name: Run to Codeception
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
METHOD: ${{ matrix.method }}
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
NO_FIXTURES: 1
run: vendor/bin/codecept -vvv run acceptance --env chrome,github_action EA10PluginCest:${METHOD}
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v2
with:
name: plugin-extend-${{ matrix.method }}-evidence
path: codeception/_output/
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: plugin-extend-${{ matrix.method }}-logs
path: var/log/
plugin-depend:
name: Plugin depend
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-22.04 ]
php: [ 7.4 ]
db: [ pgsql, mysql ]
method:
- test_dependency_each_install_plugin
- test_dependency_plugin_install
- test_dependency_plugin_update
- test_install_error
- install_enable_disable_enable_disable_remove_store
- test_enhance_plugin_entity
include:
- db: pgsql
database_url: postgres://postgres:password@127.0.0.1:5432/eccube_db
database_server_version: 11
- db: mysql
database_url: mysql://root:password@127.0.0.1:3306/eccube_db
database_server_version: 5
exclude:
- db: mysql
method: test_dependency_plugin_update
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
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
mailcatcher:
image: schickling/mailcatcher
ports:
- 1080:1080
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: Install to Composer
run: |
sudo composer selfupdate --1
composer install --dev --no-interaction -o --apcu-autoloader
- name: Setup to EC-CUBE
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
run: |
echo "APP_ENV=${APP_ENV}" > .env
bin/console doctrine:database:create --env=dev
bin/console doctrine:schema:create --env=dev
bin/console eccube:fixtures:load --env=dev
- name: Update baseinfo with pgsql
if: matrix.db == 'pgsql'
env:
PGPASSWORD: 'password'
run: |
sudo apt-fast install -y postgresql-client
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test';"
- name: Update baseinfo with mysql
if: matrix.db == 'mysql'
run: mysql -h 127.0.0.1 -u root -ppassword eccube_db -e "update dtb_base_info set authentication_key='test';"
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
- name: Run chromedriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
echo ">>> Started chrome-driver"
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
- name: Start PHP Development Server
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
run: php -S localhost:8000 &
## ${PWD}/repos does not exist so service cannot be started
- name: Run package-api
run: |
if [[ ! -d ${PWD}/repos ]]; then mkdir -p ${PWD}/repos ; fi
docker run -d --rm -v ${PWD}/repos:/repos -e MOCK_REPO_DIR=/repos -p 8080:8080 eccube/mock-package-api
- name: Run to Codeception
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
METHOD: ${{ matrix.method }}
ECCUBE_PACKAGE_API_URL: 'http://localhost:8080'
NO_FIXTURES: 1
run: vendor/bin/codecept -vvv run acceptance --env chrome,github_action EA10PluginCest:${METHOD}
- name: Upload evidence
if: failure()
uses: actions/upload-artifact@v2
with:
name: plugin-depend-${{ matrix.method }}-evidence
path: codeception/_output/
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: plugin-depend-${{ matrix.method }}-logs
path: var/log/
deploy:
name: Deploy
runs-on: ubuntu-22.04
steps:
- name: Checkout
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: actions/checkout@master
- name: Setup PHP
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: nanasess/setup-php@master
with:
php-version: '7.4'
- name: Get Composer Cache Directory
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install to Composer
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
run: |
sudo composer selfupdate --1
composer install --no-scripts --no-dev --no-interaction --optimize-autoloader
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump strategy context
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
- name: Translate to templates
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
run: php bin/template_jp.php
- name: Packaging
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
working-directory: ../
env:
TAG_NAME: ${{ github.event.release.tag_name }}
REPOSITORY_NAME: ${{ github.event.repository.name }}
PATH_NAME: eccube-${{ github.event.release.tag_name }}
run: |
rm -rf $GITHUB_WORKSPACE/.editorconfig
rm -rf $GITHUB_WORKSPACE/.gitignore
rm -rf $GITHUB_WORKSPACE/.buildpath
rm -rf $GITHUB_WORKSPACE/.gitmodules
rm -rf $GITHUB_WORKSPACE/.scrutinizer.yml
rm -rf $GITHUB_WORKSPACE/.travis.yml
rm -rf $GITHUB_WORKSPACE/appveyor.yml
rm -rf $GITHUB_WORKSPACE/.coveralls.yml
rm -rf $GITHUB_WORKSPACE/.php_cs.dist
rm -rf $GITHUB_WORKSPACE/phpunit.xml.dist
rm -rf $GITHUB_WORKSPACE/app.json
rm -rf $GITHUB_WORKSPACE/Procfile
rm -rf $GITHUB_WORKSPACE/LICENSE.txt
rm -rf $GITHUB_WORKSPACE/README.md
rm -rf $GITHUB_WORKSPACE/codeception.sh
rm -rf $GITHUB_WORKSPACE/codeception.yml
rm -rf $GITHUB_WORKSPACE/app/Plugin/*
rm -rf $GITHUB_WORKSPACE/codeception
rm -rf $GITHUB_WORKSPACE/tests
rm -rf $GITHUB_WORKSPACE/.github
find $GITHUB_WORKSPACE -name "dummy" -print0 | xargs -0 rm -rf
find $GITHUB_WORKSPACE -name ".git*" -and ! -name ".gitkeep" -print0 | xargs -0 rm -rf
find $GITHUB_WORKSPACE -name ".git*" -type d -print0 | xargs -0 rm -rf
echo "set permissions..."
chmod -R o+w $GITHUB_WORKSPACE
echo "complession files..."
mv $REPOSITORY_NAME $PATH_NAME
tar czfp eccube-$TAG_NAME.tar.gz $PATH_NAME
zip -ry eccube-$TAG_NAME.zip $PATH_NAME 1> /dev/null
md5sum eccube-$TAG_NAME.tar.gz | awk '{ print $1 }' > eccube-$TAG_NAME.tar.gz.checksum.md5
md5sum eccube-$TAG_NAME.zip | awk '{ print $1 }' > eccube-$TAG_NAME.zip.checksum.md5
sha1sum eccube-$TAG_NAME.tar.gz | awk '{ print $1 }' > eccube-$TAG_NAME.tar.gz.checksum.sha1
sha1sum eccube-$TAG_NAME.zip | awk '{ print $1 }' > eccube-$TAG_NAME.zip.checksum.sha1
sha256sum eccube-$TAG_NAME.tar.gz | awk '{ print $1 }' > eccube-$TAG_NAME.tar.gz.checksum.sha256
sha256sum eccube-$TAG_NAME.zip | awk '{ print $1 }' > eccube-$TAG_NAME.zip.checksum.sha256
mv $PATH_NAME $REPOSITORY_NAME
ls -al
- name: Upload binaries to release of TGZ
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.tar.gz
asset_name: eccube-${{ github.event.release.tag_name }}.tar.gz
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of ZIP
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.zip
asset_name: eccube-${{ github.event.release.tag_name }}.zip
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of TGZ md5 checksum
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.md5
asset_name: eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.md5
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of TGZ sha1 checksum
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.sha1
asset_name: eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.sha1
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of TGZ sha256 checksum
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.sha256
asset_name: eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.sha256
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of ZIP md5 checksum
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.zip.checksum.md5
asset_name: eccube-${{ github.event.release.tag_name }}.zip.checksum.md5
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of ZIP sha1 checksum
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.zip.checksum.sha1
asset_name: eccube-${{ github.event.release.tag_name }}.zip.checksum.sha1
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of ZIP sha256 checksum
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.zip.checksum.sha256
asset_name: eccube-${{ github.event.release.tag_name }}.zip.checksum.sha256
tag: ${{ github.ref }}
overwrite: true