From d5be4940478c831b5e845db1c87a38ec0d5ec734 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 9 Apr 2021 10:19:09 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=83=9E=E3=83=BC=E3=82=B8=E6=BC=8F?= =?UTF-8?q?=E3=82=8C=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/EC-CUBE/ec-cube/pull/4810 --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f13637b01aa..0ca8e7159be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,8 +70,7 @@ RUN curl -sS https://getcomposer.org/installer \ # 全体コピー前にcomposer installを先行完了させる(docker cache利用によるリビルド速度向上) USER www-data -RUN composer config -g repos.packagist composer https://packagist.jp \ - && composer global require hirak/prestissimo +RUN composer config -g repos.packagist composer https://packagist.jp COPY composer.json ${APACHE_DOCUMENT_ROOT}/composer.json COPY composer.lock ${APACHE_DOCUMENT_ROOT}/composer.lock RUN composer install \ From 861e6941aa8ad31ffa32eb703ac62aeb2aaabe71 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 9 Apr 2021 15:37:24 +0900 Subject: [PATCH 2/2] =?UTF-8?q?dockerbuild=20=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dockerbuild.yml | 112 +++++++++++++++++++++ codeception/_envs/github_action_docker.yml | 13 +++ 2 files changed, 125 insertions(+) create mode 100644 .github/workflows/dockerbuild.yml create mode 100644 codeception/_envs/github_action_docker.yml diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml new file mode 100644 index 00000000000..306c582b2ff --- /dev/null +++ b/.github/workflows/dockerbuild.yml @@ -0,0 +1,112 @@ +name: Testing dockerbuild +on: + push: + paths: + - 'Dockerfile' + - 'dockerbuild/*' + - 'docker-compose*.yml' + - '.github/workflows/dockerbuild.yml' + pull_request: + paths: + - 'Dockerfile' + - 'dockerbuild/*' + - 'docker-compose*.yml' + - '.github/workflows/dockerbuild.yml' + +jobs: + dockerbuild: + name: dockerbuild + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ ubuntu-18.04 ] + php: [ 7.3 ] + db: [ pgsql ] + group: [ admin01 ] + include: + - db: pgsql + database_url: postgres://dbuser:secret@127.0.0.1:15432/eccubedb + 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' + + steps: + - name: Checkout + uses: actions/checkout@master + + - name: docker build + run: docker-compose build + + - 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: 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: | + docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml up -d + docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml exec -T ec-cube bin/console doctrine:schema:create --env=dev + docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml exec -T ec-cube bin/console eccube:fixtures:load --env=dev + sed -i 's!APP_ENV: "dev"!APP_ENV: "prod"!g' docker-compose.yml + docker-compose -f docker-compose.yml -f docker-compose.pgsql.yml up -d + + - 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: Codeception + env: + APP_ENV: ${{ matrix.app_env }} + DATABASE_URL: ${{ matrix.database_url }} + DATABASE_SERVER_VERSION: ${{ matrix.database_server_version }} + MAILER_URL: 'smtp://localhost:1025' + GROUP: ${{ matrix.group }} + SYMFONY_DEPRECATIONS_HELPER: weak + run: | + echo "APP_ENV=${APP_ENV}" > .env + vendor/bin/codecept -vvv run acceptance --env chrome,github_action_docker -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/ diff --git a/codeception/_envs/github_action_docker.yml b/codeception/_envs/github_action_docker.yml new file mode 100644 index 00000000000..da7f40b6bb6 --- /dev/null +++ b/codeception/_envs/github_action_docker.yml @@ -0,0 +1,13 @@ +modules: + config: + WebDriver: + host: 'localhost' + port: 9515 + url: 'http://localhost:8080' + capabilities: + chromeOptions: + prefs: + download.default_directory: '%GITHUB_WORKSPACE%/codeception/_support/_downloads' + MailCatcher: + url: 'localhost' + port: 1080