Skip to content

Merge pull request #751 from shinya/eccube-2.17.2-p2 #982

Merge pull request #751 from shinya/eccube-2.17.2-p2

Merge pull request #751 from shinya/eccube-2.17.2-p2 #982

Workflow file for this run

name: Coverage
on:
push:
branches:
- '*'
tags:
- '*'
paths:
- '**'
- '!*.tpl'
- '!*.css'
- '!*.js'
- '!*.md'
pull_request:
paths:
- '**'
- '!*.tpl'
- '!*.css'
- '!*.js'
- '!*.md'
jobs:
run-on-linux:
name: Run on Linux
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
php: [ 7.4 ]
db: [ pgsql ]
include:
- db: pgsql
dbport: '5432'
dbuser: 'postgres'
dbpass: 'password'
dbname: 'eccube_db'
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
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@v2
- 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: |
composer install --no-interaction -o
composer require php5friends/codeception-phpunit48-wrapper ">=6.0.20" --dev
composer require captbaritone/mailcatcher-codeception-module "1.2.1" --dev
composer require codeception/codeception "*" --dev
composer remove php5friends/codeception-phpunit48-wrapper --dev
composer remove php5friends/phpunit48 --ignore-platform-reqs --dev
- name: Create ADMIN_DIR
run: |
sudo apt-fast install -y sharutils
echo "ADMIN_DIR=$(head -c 10 < /dev/random | uuencode -m - | tail -n 2 |head -n 1 | sed 's,[/+],_,g' | head -c10)/" >> $GITHUB_ENV
- name: Setup to EC-CUBE
env:
DB: ${{ matrix.db }}
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
HTTP_URL: http://127.0.0.1:8085/
HTTPS_URL: http://127.0.0.1:8085/
run: |
sudo apt-fast install -y mysql-client postgresql-client
./eccube_install.sh ${DB}
- name: Run to PHPUnit
continue-on-error: true
run: phpdbg -qrr data/vendor/bin/phpunit --exclude-group classloader --coverage-clover=coverage1.xml
- name: Run to PHPUnit classloader
continue-on-error: true
run: phpdbg -qrr data/vendor/bin/phpunit --group classloader --coverage-clover=coverage2.xml
- name: Run to PHPUnit SessionFactory
continue-on-error: true
run: |
sed 's|http://|https://|g' -i.bak data/config/config.php
phpdbg -qrr data/vendor/bin/phpunit tests/class/SC_SessionFactoryTest.php --coverage-clover=coverage3.xml
mv data/config/config.php.bak data/config/config.php
- name: Install symfony/cli
continue-on-error: true
run: |
wget https://get.symfony.com/cli/installer -O - | bash
sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony
symfony local:php:list
- 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: Setup C3
run: |
wget https://raw.github.com/Codeception/c3/2.0/c3.php
sed -i 's,/vendor/autoload.php,/data/vendor/autoload.php,g' c3.php
echo "include __DIR__.'/../c3.php';" >> html/define.php
- name: Run to Codeception
continue-on-error: true
env:
DB: ${{ matrix.db }}
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
HTTP_URL: http://127.0.0.1:8085/
HTTPS_URL: http://127.0.0.1:8085/
XDEBUG_MODE: coverage
run: |
sudo phpenmod -s cli xdebug
sudo phpenmod -s fpm xdebug
mv html/admin html/${ADMIN_DIR}
php data/vendor/bin/codecept build
symfony serve -d --no-tls --port=8085 --document-root=html
php data/vendor/bin/codecept run --env chrome,http --skip-group installer --skip-group excludeCoverage --steps --coverage --coverage-xml
mv ./ctests/_output/acceptance\ \(chrome,\ http\).remote.coverage.xml ctests/_output/acceptance.remote.coverage.xml
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
files: ./coverage1.xml,./coverage2.xml,./coverage3.xml,./ctests/_output/acceptance.remote.coverage.xml
# token: ${{ secrets.CODECOV_TOKEN }}
flags: tests
# yml: ./codecov.yml
fail_ci_if_error: true
- name: Upload evidence
uses: actions/upload-artifact@v2
with:
name: coverage-evidence
path: ctests/_output/