Skip to content

Commit

Permalink
Merge pull request #8 from maximehuran/feature/generate-test-application
Browse files Browse the repository at this point in the history
Generate test application automatically
  • Loading branch information
maximehuran committed Apr 8, 2022
2 parents 5b0fc7b + f313f9f commit 1dc4fd3
Show file tree
Hide file tree
Showing 111 changed files with 2,383 additions and 1,212 deletions.
85 changes: 85 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.feature]
indent_style = space
indent_size = 4

[*.js]
indent_style = space
indent_size = 2

[*.json]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.neon]
indent_style = space
indent_size = 4

[*.php]
indent_style = space
indent_size = 4

[*.sh]
indent_style = space
indent_size = 4

[*.{yaml,yml}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[.babelrc]
indent_style = space
indent_size = 2

[.gitmodules]
indent_style = tab
indent_size = 4

[.php_cs{,.dist}]
indent_style = space
indent_size = 4

[composer.json]
indent_style = space
indent_size = 4

[package.json]
indent_style = space
indent_size = 2

[phpspec.yml{,.dist}]
indent_style = space
indent_size = 4

[phpstan.neon]
indent_style = space
indent_size = 4

[phpunit.xml{,.dist}]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab
85 changes: 85 additions & 0 deletions .github/workflows/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Flex Recipe

on:
push:
branches: [ master ]
pull_request:

jobs:

recipe:

runs-on: ubuntu-latest

env:
SYMFONY_ENDPOINT: http://127.0.0.1/

strategy:
fail-fast: false
matrix:
php: ['7.4' ,'8.0']
sylius: ["~1.8.0", "~1.9.0", "~1.10.0"]
exclude:
- php: 8.0
sylius: "~1.8.0"
- php: 8.0
sylius: "~1.9.0"

steps:
- name: Setup PHP
run: |
sudo update-alternatives --set php /usr/bin/php${{ matrix.php }}
echo "date.timezone=UTC" >> /tmp/timezone.ini
sudo mv /tmp/timezone.ini /etc/php/${{ matrix.php }}/cli/conf.d/timezone.ini
echo ${{ matrix.php }} > .php-version
- uses: actions/checkout@v2
with:
path: plugin

# Run the server at the start so it can download the recipes!
- name: Run standalone symfony flex server
run: |
echo ${{ github.token }} | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
docker run --rm --name flex -d -v $PWD/plugin/recipes:/var/www/flex/var/repo/private/monsieurbiz/sylius-sales-reports-plugin -p 80:80 docker.pkg.github.com/monsieurbiz/docker/symfony-flex-server:latest contrib official
docker ps
- run: mkdir -p /home/runner/{.composer/cache,.config/composer}

- uses: actions/cache@v1
id: cache-composer
with:
path: /home/runner/.composer/cache
key: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-

- name: Composer v2
run: sudo composer self-update --2

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

- name: Create Sylius-Standard project without install
run: |
composer create-project --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard sylius "${{ matrix.sylius }}"
- name: Setup some requirements
working-directory: ./sylius
run: |
composer config repositories.plugin '{"type": "path", "url": "../plugin/"}'
composer config extra.symfony.allow-contrib true
composer config secure-http false
composer config --unset platform.php
- name: Require plugin without install
working-directory: ./sylius
run: |
composer require --no-install --no-update monsieurbiz/sylius-sales-reports-plugin="*@dev"
- name: Composer install
working-directory: ./sylius
run: |
composer install
- name: Show flex server logs
run: docker logs --tail 100 flex
48 changes: 48 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Security

on:
push:
pull_request:

jobs:

security:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0']

steps:
- uses: actions/checkout@v2

- name: Setup PHP
run: |
sudo update-alternatives --set php /usr/bin/php${{ matrix.php }}
echo "date.timezone=UTC" | sudo tee /etc/php/${{ matrix.php }}/cli/conf.d/timezone.ini
echo "${{ matrix.php }}" > .php-version
- uses: actions/cache@v1
id: cache-composer
with:
path: /home/runner/.composer/cache
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-

- run: mkdir -p /home/runner/{.composer/cache,.config/composer}
if: steps.cache-composer.outputs.cache-hit != 'true'

- name: Composer v2
run: sudo composer self-update --2

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

- uses: actions/checkout@v2

- name: Install PHP dependencies
run: composer update --prefer-dist

- uses: symfonycorp/security-checker-action@v2
74 changes: 74 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Tests

on:
push:
branches: [ master ]
pull_request:

jobs:

php:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0']

env:
SYMFONY_ARGS: --no-tls
COMPOSER_ARGS: --prefer-dist
DOCKER_INTERACTIVE_ARGS: -t

steps:
- uses: actions/checkout@v2

- name: Setup PHP
run: |
sudo update-alternatives --set php /usr/bin/php${{ matrix.php }}
echo "date.timezone=UTC" | sudo tee /etc/php/${{ matrix.php }}/cli/conf.d/timezone.ini
echo "${{ matrix.php }}" > .php-version
- name: Install symfony CLI
run: |
curl https://get.symfony.com/cli/installer | bash
echo "${HOME}/.symfony/bin" >> $GITHUB_PATH
- uses: actions/cache@v1
id: cache-composer
with:
path: /home/runner/.composer/cache
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-

- run: mkdir -p /home/runner/{.composer/cache,.config/composer}
if: steps.cache-composer.outputs.cache-hit != 'true'

- name: Composer v2
run: sudo composer self-update --2

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

- run: make install

- run: make test.composer

- run: make test.phpcs

- run: make test.phpunit

- run: make test.phpstan

- run: make test.phpmd

- run: make test.phpspec

- run: make test.yaml

- run: make test.twig

- run: make test.schema

- run: make test.container
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/vendor/
/node_modules/
/composer.lock

/etc/build/*
!/etc/build/.gitignore

/tests/Application/yarn.lock
/tests/Application

/behat.yml
/phpspec.yml

/package-lock.json

/.php-version
/php.ini
/.phpunit.result.cache
/node_modules
/yarn.lock
Loading

0 comments on commit 1dc4fd3

Please sign in to comment.