Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Actions #1329

Merged
merged 18 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Behat
on:
push:
branches: [ master, '3.0' ]
pull_request:
branches: [ master, '3.0' ]

jobs:
behat:
runs-on: ubuntu-latest
env:
PIMCORE_ENVIRONMENT: "test"
CORESHOP_TEST: 1
PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/coreshop_test"
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: coreshop_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [7.2, 7.3, 7.4]
symfony: [~3.4, ^4.0]
pimcore: [~6.5.0, dev-master]

steps:
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl

- name: Check PHP Version
run: php -v

- name: Start mysql service
run: sudo /etc/init.d/mysql start

- name: Verify MySQL connection from host
run: |
sudo apt-get install -y mysql-client
mysql -uroot -h127.0.0.1 -proot -e "SHOW DATABASES"

- name: Setup mysql
run: |
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_file_format=Barracuda;"
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_large_prefix=1;"
mysql -uroot -h127.0.0.1 -proot -e "CREATE DATABASE coreshop_test CHARSET=utf8mb4;"

- name: Copy parameters.yml
run: cp app/config/parameters.example.yml app/config/parameters.yml

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Composer install
run: |
composer config minimum-stability dev
composer config prefer-stable true
composer req pimcore/pimcore:${{ matrix.pimcore }} symfony/symfony:${{ matrix.symfony }} --no-interaction --no-scripts --no-update
composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader

- name: Cache clear
run: bin/console cache:clear

- name: Assets Install
run: bin/console assets:install --symlink web

- name: Run Behat
run: vendor/bin/behat --strict --no-interaction -vvv -f progress --config behat.yml.dist
26 changes: 26 additions & 0 deletions .github/workflows/composer_validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Composer Validate
on:
push:
branches: [ master, '3.0' ]
pull_request:
branches: [ master, '3.0' ]

jobs:
validate:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate

- name: Validate composer.json in packages
run: |
packages="$(find "src/CoreShop" -mindepth 3 -maxdepth 3 -type f -name composer.json -exec dirname '{}' \;)"

for package in $packages
do
echo "Validating Package" "$(basename "$package")"
composer validate --ansi --strict $package/composer.json
done
68 changes: 68 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Lint
on:
push:
branches: [ master, '3.0' ]
pull_request:
branches: [ master, '3.0' ]

jobs:
lint:
runs-on: ubuntu-latest
env:
PIMCORE_ENVIRONMENT: "test"
PIMCORE_TEST_DB_DSN: "mysql://root:root@localhost/coreshop_test"
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: coreshop_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
extensions: intl

- name: Copy parameters.yml
run: cp app/config/parameters.example.yml app/config/parameters.yml

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Start mysql service
run: sudo /etc/init.d/mysql start

- name: Verify MySQL connection from host
run: |
sudo apt-get install -y mysql-client
mysql -uroot -h127.0.0.1 -proot -e "SHOW DATABASES"

- name: Setup mysql
run: |
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_file_format=Barracuda;"
mysql -uroot -h127.0.0.1 -proot -e "SET GLOBAL innodb_large_prefix=1;"
mysql -uroot -h127.0.0.1 -proot -e "CREATE DATABASE coreshop_test CHARSET=utf8mb4;"

- name: Composer install
run: composer install --prefer-dist --no-progress --no-suggest

- name: Validate YAML
run: bin/console lint:yaml src --no-debug

- name: Validate TWIG
run: bin/console lint:twig src --no-debug