-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Prepare dependency;Install bitbag/coding-standard * Delete always true assertions and redundant parameters, add variables to PHPDocs, fix invalid method names * Fix src dir with bitbag/codin-standard tool * Fix tests dir with bitbag/codin-standard tool * New workflow * Add PHP 7.3 and env * Delete .env.local * Fix doctrine conflict * Add doctrine conflict * Add env to build.yml * Remove unnecessary line from build.yml * Fix build.yaml invalid format * MailChimpContext fixed * Fix too wide specification in .gitignore file
- Loading branch information
Showing
21 changed files
with
224 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Coding standard | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'dependabot/**' | ||
pull_request: ~ | ||
release: | ||
types: [created] | ||
schedule: | ||
- | ||
cron: "0 1 * * 6" # Run at 1am every Saturday | ||
workflow_dispatch: ~ | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [7.4, 7.3, 8.0] | ||
symfony: [^4.4, ^5.2] | ||
sylius: [~1.8.0, ~1.9.0, ~1.10.0] | ||
node: [10.x] | ||
mysql: [5.7] | ||
|
||
exclude: | ||
- | ||
php: 7.3 | ||
mysql: 8.0 | ||
- | ||
sylius: ~1.8.0 | ||
symfony: ^5.2 | ||
- | ||
sylius: ~1.8.0 | ||
php: 8.0 | ||
- | ||
sylius: ~1.9.0 | ||
php: 8.0 | ||
- | ||
sylius: ~1.10.0 | ||
php: 7.3 | ||
|
||
env: | ||
APP_ENV: test | ||
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}" | ||
|
||
steps: | ||
- | ||
uses: actions/checkout@v2 | ||
- | ||
name: Get Composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- | ||
name: Cache Composer | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php }}-composer- | ||
- | ||
name: Restrict Symfony version | ||
if: matrix.symfony != '' | ||
run: | | ||
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10" | ||
composer config extra.symfony.require "${{ matrix.symfony }}" | ||
- | ||
name: Restrict Sylius version | ||
if: matrix.sylius != '' | ||
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction | ||
|
||
- | ||
name: Install PHP dependencies | ||
run: composer install --no-interaction | ||
|
||
- | ||
name: Run PHPStan | ||
run: vendor/bin/phpstan analyse -c phpstan.neon -l 7 src/ | ||
|
||
- name: Run ECS | ||
run: vendor/bin/ecs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,18 +14,36 @@ on: | |
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-18.04 | ||
runs-on: ubuntu-latest | ||
|
||
name: "PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" | ||
name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [7.4] | ||
symfony: [^5.2] | ||
php: [7.4, 7.3, 8.0] | ||
symfony: [^4.4, ^5.2] | ||
sylius: [~1.8.0, ~1.9.0, ~1.10.0] | ||
node: [10.x] | ||
mysql: [5.7] | ||
|
||
exclude: | ||
- | ||
php: 7.3 | ||
mysql: 8.0 | ||
- | ||
sylius: ~1.8.0 | ||
symfony: ^5.2 | ||
- | ||
sylius: ~1.8.0 | ||
php: 8.0 | ||
- | ||
sylius: ~1.9.0 | ||
php: 8.0 | ||
- | ||
sylius: ~1.10.0 | ||
php: 7.3 | ||
|
||
env: | ||
APP_ENV: test | ||
DATABASE_URL: "mysql://root:[email protected]/sylius?serverVersion=${{ matrix.mysql }}" | ||
|
@@ -59,34 +77,11 @@ jobs: | |
with: | ||
mysql version: "${{ matrix.mysql }}" | ||
mysql root password: "root" | ||
|
||
- | ||
name: Configure sysctl limits | ||
run: | | ||
sudo swapoff -a | ||
sudo sysctl -w vm.swappiness=1 | ||
sudo sysctl -w fs.file-max=262144 | ||
sudo sysctl -w vm.max_map_count=262144 | ||
- | ||
name: Runs Elasticsearch | ||
uses: elastic/elastic-github-actions/elasticsearch@master | ||
with: | ||
stack-version: 6.8.15 | ||
|
||
- | ||
name: Output PHP version for Symfony CLI | ||
run: php -v | head -n 1 | awk '{ print $2 }' > .php-version | ||
|
||
- | ||
name: Install wkhtmltopdf | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install xvfb libfontconfig wkhtmltopdf --fix-missing | ||
echo 'xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf "$@"' > "/usr/local/bin/wkhtmltopdf.sh" | ||
sudo chmod a+x /usr/local/bin/wkhtmltopdf.sh | ||
echo export WKHTMLTOPDF_PATH="/usr/local/wkhtmltopdf.sh" | ||
- | ||
name: Install certificates | ||
run: symfony server:ca:install | ||
|
@@ -97,12 +92,7 @@ jobs: | |
|
||
- | ||
name: Run webserver | ||
run: symfony server:start --port=8080 --dir=public --daemon | ||
|
||
- | ||
name: Restrict Symfony version | ||
if: matrix.symfony != '' | ||
run: composer config extra.symfony.require "${{ matrix.symfony }}" | ||
run: (cd tests/Application && symfony server:start --port=8080 --dir=public --daemon) | ||
|
||
- | ||
name: Get Composer cache directory | ||
|
@@ -117,8 +107,19 @@ jobs: | |
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php }}-composer- | ||
- | ||
name: Restrict Symfony version | ||
if: matrix.symfony != '' | ||
run: | | ||
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^1.10" | ||
composer config extra.symfony.require "${{ matrix.symfony }}" | ||
- | ||
name: Restrict Sylius version | ||
if: matrix.sylius != '' | ||
run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction | ||
|
||
- name: Install PHP dependencies | ||
- | ||
name: Install PHP dependencies | ||
run: composer install --no-interaction | ||
|
||
- | ||
|
@@ -134,7 +135,6 @@ jobs: | |
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ matrix.node }}-yarn- | ||
- | ||
name: Install JS dependencies | ||
run: (cd tests/Application && yarn install) | ||
|
@@ -143,38 +143,50 @@ jobs: | |
name: Prepare test application database | ||
run: | | ||
(cd tests/Application && bin/console doctrine:database:create -vvv) | ||
(cd tests/Application && bin/console doctrine:migrations:migrate -n -vvv) | ||
(cd tests/Application && bin/console doctrine:schema:create -vvv) | ||
- | ||
name: Prepare test application assets | ||
run: | | ||
(cd tests/Application && bin/console assets:install public -vvv) | ||
(cd tests/Application && yarn build) | ||
- | ||
name: Prepare test application cache | ||
run: (cd tests/Application && bin/console cache:warmup -vvv) | ||
|
||
- | ||
name: Load fixtures | ||
name: Load fixtures in test application | ||
run: (cd tests/Application && bin/console sylius:fixtures:load -n) | ||
|
||
- | ||
- | ||
name: Validate composer.json | ||
run: composer validate --ansi --strict --no-check-publish | ||
|
||
- | ||
name: Run security check | ||
run: symfony security:check | ||
|
||
- | ||
name: Run PHPStan | ||
run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/ | ||
run: composer validate --ansi --strict | ||
|
||
- | ||
- | ||
name: Validate database schema | ||
run: (cd tests/Application && bin/console doctrine:schema:validate) | ||
|
||
- | ||
name: Run PHPStan | ||
run: vendor/bin/phpstan analyse -c phpstan.neon -l 7 src/ | ||
|
||
- | ||
name: Run PHPSpec | ||
run: vendor/bin/phpspec run --ansi -f progress --no-interaction | ||
|
||
|
||
- | ||
name: Run Behat | ||
env: | ||
MAIL_CHIMP_API_KEY: ${{ secrets.MAILCHIMP_API_TOKEN }} | ||
MAIL_CHIMP_LIST_ID: ${{ secrets.MAIL_CHIMP_LIST_ID }} | ||
MAIL_CHIMP_WEBHOOK_SECRET: ${{ secrets.MAIL_CHIMP_WEBHOOK_SECRET }} | ||
run: vendor/bin/behat --colors --strict -vvv --no-interaction || vendor/bin/behat --colors --strict -vvv --no-interaction --rerun | ||
|
||
- | ||
name: Upload Behat logs | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: Behat logs | ||
path: etc/build/ | ||
if-no-files-found: ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ | |
!/etc/build/.gitkeep | ||
|
||
/tests/Application/yarn.lock | ||
/.env.*.local | ||
/.env.local | ||
/.env.local.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ Feature: Updating not subscribed customer | |
Background: | ||
Given the store operates on a single channel | ||
And there is no customer with "[email protected]" email | ||
And there is a created list in MailChimp with specified ID | ||
|
||
|
||
Scenario: Subscribing to newsletter as customer | ||
Given I want to subscribe to the newsletter | ||
|
@@ -15,4 +15,4 @@ Feature: Updating not subscribed customer | |
Then the "[email protected]" customer should be created | ||
And the customer should be subscribed to the newsletter | ||
And I should be notified that I am subscribed to the newsletter | ||
And the email "[email protected]" should be exported to MailChimp's default list | ||
And the email "[email protected]" should be exported to MailChimp's default list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ Feature: Creating new newsletter customer | |
Background: | ||
Given the store operates on a single channel | ||
And there is no customer with "[email protected]" email | ||
And there is a created list in MailChimp with specified ID | ||
|
||
|
||
Scenario: Subscribing to newsletter as guest | ||
Given I want to subscribe to the newsletter | ||
|
@@ -16,4 +16,4 @@ Feature: Creating new newsletter customer | |
Then the "[email protected]" customer should be created | ||
And the customer should be subscribed to the newsletter | ||
And I should be notified that I am subscribed to the newsletter | ||
And the email "[email protected]" should be exported to MailChimp's default list | ||
And the email "[email protected]" should be exported to MailChimp's default list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ Feature: Validating newsletter form | |
|
||
Background: | ||
Given the store operates on a single channel | ||
And there is a created list in MailChimp with specified ID | ||
|
||
|
||
Scenario: Subscribing to newsletter with invalid email | ||
When I want to subscribe to the newsletter | ||
|
@@ -26,4 +26,4 @@ Feature: Validating newsletter form | |
When I want to subscribe to the newsletter | ||
And I fill newsletter with "[email protected]" email | ||
And I subscribe to it | ||
Then I should be notified that the submitted email is already subscribed to the newsletter | ||
Then I should be notified that the submitted email is already subscribed to the newsletter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.