Skip to content

Commit

Permalink
fixed EC-CUBE#5023 コンフリクト解消
Browse files Browse the repository at this point in the history
  • Loading branch information
carkn committed Nov 29, 2021
2 parents 2723154 + 530906d commit f398d92
Show file tree
Hide file tree
Showing 651 changed files with 19,826 additions and 7,130 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
vendor
.git
var
node_modules
bin/.phpunit
3 changes: 3 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,8 @@ MAILER_URL=null://localhost
#ECCUBE_GC_MAXLIFETIME=1440
#ECCUBE_ADMIN_USER=admin
#ECCUBE_ADMIN_PASS=password
#ECCUBE_2FA_ENABLED=true
#ECCUBE_2FA_COOKIE_NAME=eccube_2fa
#ECCUBE_2FA_EXPIRE=14

###< APPLICATION CONFIG ###
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
## マイナーバージョン互換性保持のための制限事項チェックリスト
<!-- マイナーバージョンでは、機能・プラグイン・デザインテンプレート互換性を損なう変更は原則取り込みません。 -->

- [ ] 既存機能の仕様変更
- [ ] フックポイントの呼び出しタイミングの変更
- [ ] フックポイントのパラメータの削除・データ型の変更
- [ ] twigファイルに渡しているパラメータの削除・データ型の変更
- [ ] Serviceクラスの公開関数の、引数の削除・データ型の変更
- [ ] 入出力ファイル(CSVなど)のフォーマット変更
- [ ] 既存機能の仕様変更はありません
- [ ] フックポイントの呼び出しタイミングの変更はありません
- [ ] フックポイントのパラメータの削除・データ型の変更はありません
- [ ] twigファイルに渡しているパラメータの削除・データ型の変更はありません
- [ ] Serviceクラスの公開関数の、引数の削除・データ型の変更はありません
- [ ] 入出力ファイル(CSVなど)のフォーマット変更はありません

## レビュワー確認項目

Expand Down
194 changes: 181 additions & 13 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
include:
- db: pgsql
database_url: postgres://postgres:[email protected]:5432/eccube_db
database_server_version: 11
database_server_version: 14
services:
postgres:
image: postgres:11
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
Expand All @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -58,9 +58,14 @@ jobs:
php-version: ${{ matrix.php }}

- name: composer install
run: composer install --dev --no-interaction -o --apcu-autoloader

- name: Setup pcov
run: |
sudo composer selfupdate --1
composer install --dev --no-interaction -o --apcu-autoloader
sudo apt-fast install -y php7.4-pcov
sudo phpenmod -s cli pcov
composer require pcov/clobber --dev
vendor/bin/pcov clobber
- name: Setup EC-CUBE
env:
Expand All @@ -76,16 +81,179 @@ jobs:
APP_ENV: 'test'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://localhost:1025'
MAILER_URL: 'smtp://127.0.0.1:1025'
continue-on-error: true
run: bin/phpunit --exclude-group cache-clear,cache-clear-install,update-schema-doctrine --coverage-clover=coverage1.xml
- name: Upload report
if: success()
uses: actions/upload-artifact@v2
with:
name: phpunit-reports
path: coverage1.xml
codeception:
name: Codeception
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-18.04 ]
php: [ 7.4 ]
db: [ pgsql ]
group: [ admin01, admin02, admin03, front, installer ]
include:
- db: pgsql
database_url: postgres://postgres:[email protected]:5432/eccube_db
database_server_version: 14
- 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:14
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
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: 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: 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:composer2
cp codeception/_data/plugins/*-1.0.0.tgz repos
- name: Setup xdebug
run: |
bin/phpunit --version
phpdbg -dmemory_limit=-1 -qrr bin/phpunit --exclude-group cache-clear,cache-clear-install,update-schema-doctrine --coverage-clover=coverage1.xml
- name: Upload coverage
composer require --dev codeception/c3 "2.*"
sudo phpenmod -s cli xdebug
sed -i "7a include __DIR__.'/c3.php';" index.php
- name: Start PHP Development Server
env:
APP_ENV: 'codeception'
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://127.0.0.1:1025'
ECCUBE_PACKAGE_API_URL: 'http://127.0.0.1:8080'
XDEBUG_MODE: coverage
run: php -S 127.0.0.1:8000 &

- name: Codeception
env:
APP_ENV: ${{ matrix.app_env }}
DATABASE_URL: ${{ matrix.database_url }}
DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }}
MAILER_URL: 'smtp://127.0.0.1:1025'
ECCUBE_PACKAGE_API_URL: 'http://127.0.0.1:8080'
GROUP: ${{ matrix.group }}
SYMFONY_DEPRECATIONS_HELPER: weak
XDEBUG_MODE: coverage
continue-on-error: true
run: vendor/bin/codecept -vvv run acceptance --env chrome,github_action -g ${GROUP} --skip-group excludeCoverage --coverage --coverage-xml
- name: Upload outputs
uses: actions/upload-artifact@v2
with:
name: codeception-${{ matrix.group }}-evidence
path: codeception/_output/
- name: Upload report
if: success()
uses: actions/upload-artifact@v2
with:
name: codeception-${{ matrix.group }}-reports
path: codeception/_output/**/*.xml
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: codeception-${{ matrix.group }}-logs
path: var/log/

upload:
name: Upload coverage reports
runs-on: ubuntu-latest
needs: [ phpunit, codeception ]
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: reports
- run: |
mv reports/codeception-admin01-reports/acceptance\ \(chrome,\ github_action\).remote.coverage.xml reports/acceptance.admin01.coverage.xml
mv reports/codeception-admin02-reports/acceptance\ \(chrome,\ github_action\).remote.coverage.xml reports/acceptance.admin02.coverage.xml
mv reports/codeception-admin03-reports/acceptance\ \(chrome,\ github_action\).remote.coverage.xml reports/acceptance.admin03.coverage.xml
mv reports/codeception-front-reports/acceptance\ \(chrome,\ github_action\).remote.coverage.xml reports/acceptance.front.coverage.xml
mv reports/codeception-installer-reports/acceptance\ \(chrome,\ github_action\).remote.coverage.xml reports/acceptance.installer.coverage.xml
- name: Upload unit test coverage
uses: codecov/codecov-action@v1
with:
files: ./reports/phpunit-reports/coverage1.xml
flags: Unit
fail_ci_if_error: true
- name: Upload E2E coverage
uses: codecov/codecov-action@v1
with:
files: ./coverage1.xml
# token: ${{ secrets.CODECOV_TOKEN }}
flags: tests
# yml: ./codecov.yml
files: ./reports/acceptance.admin01.coverage.xml,./reports/acceptance.admin02.coverage.xml,./reports/acceptance.admin03.coverage.xml,./reports/acceptance.front.coverage.xml,./reports/acceptance.installer.coverage.xml
flags: E2E
fail_ci_if_error: true
132 changes: 132 additions & 0 deletions .github/workflows/deny-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Deny check for EC-CUBE
on:
push:
branches:
- '*'
tags:
- '*'
paths:
- '**'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.md'
jobs:
deploy:
name: Deny check
runs-on: ubuntu-18.04
services:
postgres:
image: postgres:14
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: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: '7.4'

- 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: Install to Composer
run: composer install --no-scripts --no-dev --no-interaction --optimize-autoloader

- name: Translate to templates
run: php bin/template_jp.php

- name: Setup to EC-CUBE
env:
APP_ENV: 'prod'
DATABASE_URL: postgres://postgres:[email protected]:5432/eccube_db
DATABASE_SERVER_VERSION: 14
run: |
rm -rf $GITHUB_WORKSPACE/app/Plugin/*
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: Install Plugins
env:
APP_ENV: 'prod'
DATABASE_URL: postgres://postgres:[email protected]:5432/eccube_db
DATABASE_SERVER_VERSION: 14
run: |
bin/console eccube:composer:require "ec-cube/recommend4"
bin/console eccube:composer:require "ec-cube/coupon4"
bin/console eccube:composer:require "ec-cube/mailmagazine4"
bin/console eccube:composer:require "ec-cube/salesreport4"
bin/console eccube:composer:require "ec-cube/relatedproduct4"
bin/console eccube:composer:require "ec-cube/securitychecker4"
bin/console eccube:composer:require "ec-cube/productreview4"
bin/console eccube:composer:require "ec-cube/api"
bin/console eccube:composer:require "ec-cube/sitekit"
bin/console eccube:composer:require "ec-cube/gmc"
- name: Pre Install Plugins
env:
PGPASSWORD: 'password'
run: psql eccube_db -h 127.0.0.1 -U postgres -c "select id,name,code,0 as enabled,version,source,0 as initialized,'2021-08-13 00:00:00' as create_date,'2021-08-13 00:00:00' as update_date,discriminator_type from dtb_plugin;" -A -F, --pset footer > src/Eccube/Resource/doctrine/import_csv/ja/dtb_plugin.csv

- name: Packaging
working-directory: ../
run: ${{ github.event.repository.name }}/package.sh

- name: Build Container
run: docker build -t ec-cube --build-arg SKIP_INSTALL_SCRIPT_ON_DOCKER_BUILD=true .

- name: Container Run
run: |
docker run -e APP_ENV=prod -e APP_DEBUG=0 -e DATABASE_URL="sqlite:///var/eccube.db" -e DATABASE_SERVER_VERSION=3 --rm -d -p 8080:80 --name eccube ec-cube
docker cp ../eccube.tar.gz eccube:/tmp/
docker exec -w /tmp eccube bash -c "rm -rf /var/www/html; tar xf /tmp/eccube.tar.gz -C /var/www; mv /var/www/ec-cube /var/www/html; chown -R www-data: /var/www/html"
docker exec -u www-data eccube bin/console eccube:install -n
docker exec -u www-data eccube bash -c 'for code in Api Coupon4 GMC MailMagazine4 ProductReview4 Recommend4 RelatedProduct4 SalesReport4 Securitychecker4 SiteKit; do bin/console eccube:plugin:enable --code $code; done'
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master

- name: Prepare test
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"
composer install --no-scripts --no-interaction --optimize-autoloader
echo "modules:
enabled:
- REST:
depends: PhpBrowser
url: 'http://127.0.0.1:8080'
config:
WebDriver:
host: '127.0.0.1'
port: 9515
url: 'http://127.0.0.1:8080'" > codeception/_envs/local.yml
- name: Run tests
env:
APP_ENV: 'codeception'
DATABASE_URL: postgres://postgres:[email protected]:5432/eccube_db
DATABASE_SERVER_VERSION: 14
run: |
vendor/bin/codecept -vvv run acceptance --env chrome,local CL01DenyCest
Loading

0 comments on commit f398d92

Please sign in to comment.