Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
Fix #14 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Oct 29, 2020
1 parent 53ee279 commit b7c641f
Show file tree
Hide file tree
Showing 12 changed files with 253 additions and 49 deletions.
64 changes: 64 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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 = 2

[*.js]
indent_style = space
indent_size = 2

[*.json]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.php]
indent_style = space
indent_size = 4

[*.sh]
indent_style = tab
indent_size = 4

[*.xml]
indent_style = space
indent_size = 4

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

[.github/workflows/*.{yaml,yml}]
indent_style = space
indent_size = 2

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

[composer.json]
indent_style = space
indent_size = 4

[phpunit.xml{,.dist}]
indent_style = space
indent_size = 4
46 changes: 46 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at vincentchalamon+abuse@gmail.com We will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
File renamed without changes.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- Please update this template with something that matches your PR -->
| Q | A
| ------------- | ---
| Bug fix? | yes/no
Expand All @@ -7,5 +8,3 @@
| Tests pass? | yes
| Fixed tickets | #1234, #5678
| License | MIT

*Please update this template with something that matches your PR*
86 changes: 60 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,101 @@ name: CI

on:
schedule:
- cron: 0 2 * * 1-5
# Every sunday at 02:00
- cron: 0 2 * * 0
pull_request:
push:
branches:
- master

jobs:
tests:
name: Tests PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }} (${{ matrix.dependency }})
name: Tests PHP ${{ matrix.php }} ${{ matrix.dependency }} (Symfony ${{ matrix.symfony }})
runs-on: ubuntu-latest
container:
image: php:${{ matrix.php }}
strategy:
# https://gitpro.ttaallkk.topmunity/t5/GitHub-Actions/GitHub-Actions-Matrix-options-dont-work-as-documented/m-p/29558
matrix:
php:
- '7.2'
- '7.3'
- '7.4'
- 'rc'
symfony:
- '3.4.*'
- '4.4.*'
- '5.1.*'
dependency:
- '--prefer-stable'
- '--prefer-stable --prefer-lowest'
- ''
- 'lowest'
include:
- php: '7.4'
dependency: ''
symfony: '5.1.*'
bootable: true
exclude:
- symfony: '3.4.*'
dependency: 'lowest'
- symfony: '4.4.*'
dependency: 'lowest'
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install system packages
run: |
apt-get update
apt-get install -y --no-install-recommends \
unzip
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: composer:v2, flex
tools: php-cs-fixer

- name: Disable PHP memory limit
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Install Composer
run: curl -sS -o - https://raw.githubusercontent.com/composer/getcomposer.org/ba13e3fc70f1c66250d1ea7ea4911d593aa1dba5/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- 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: Configure Symfony
run: |
composer global require symfony/flex
composer config extra.symfony.require "${{ matrix.symfony }}"
run: composer config extra.symfony.require "${{ matrix.symfony }}"

- name: Update project dependencies
run: composer update --no-progress --no-suggest --ansi ${{ matrix.dependency }}
if: matrix.dependency == ''
run: composer update --no-progress --ansi --prefer-stable

- name: Update project dependencies lowest
if: matrix.dependency == 'lowest'
run: composer update --no-progress --ansi --prefer-lowest --prefer-stable

- name: Disable deprecations notices for lowest dependencies
if: matrix.dependency == 'lowest'
run: echo "SYMFONY_DEPRECATIONS_HELPER=weak" >> $GITHUB_ENV

- name: Bundle is bootable
if: matrix.bootable
env:
SKELETON_VERSION: ${{matrix.symfony}}
run: |
composer create-project "symfony/skeleton:${SKELETON_VERSION}" flex
cd flex
composer config extra.symfony.allow-contrib true
composer req --ignore-platform-reqs tilleuls/migration-bundle
- name: Run php-cs-fixer tests
if: matrix.php != 'rc'
run: php-cs-fixer fix --diff --dry-run

- name: Run PHPUnit tests
run: vendor/bin/simple-phpunit

- name: Run Behat tests
run: |
mkdir -p features/app/cache/test/doctrine/orm/Proxies features/app/logs
vendor/bin/behat
- name: Run PHPUnit tests
run: vendor/bin/phpunit

- name: Run PHPStan tests
if: matrix.dependency == ''
run: vendor/bin/phpstan

- name: Run php-cs-fixer tests
run: vendor/bin/php-cs-fixer fix --dry-run --diff
2 changes: 1 addition & 1 deletion .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ HEADER;

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('features/app');
->exclude(['features', 'flex']);

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
Expand Down
19 changes: 14 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=7.2",
"php": "^7.2",
"doctrine/annotations": "^1.2",
"doctrine/dbal": "^2.5",
"doctrine/doctrine-bundle": "^1.7.2 || ^2.0",
Expand All @@ -32,14 +32,14 @@
"require-dev": {
"behat/behat": "^3.1",
"doctrine/data-fixtures": "^1.2",
"friends-of-behat/symfony-extension": "^2.0.10@beta",
"friendsofphp/php-cs-fixer": "^2.15.5",
"doctrine/doctrine-cache-bundle": "^1.4",
"friends-of-behat/symfony-extension": "^2.1.0",
"ocramius/proxy-manager": "^2.0.4",
"phpspec/prophecy": "^1.10",
"phpstan/phpstan": "^0.12.17",
"phpunit/phpunit": "^8.0",
"symfony/browser-kit": "^3.4 || ^4.4 || ^5.0",
"symfony/framework-bundle": "^3.4 || ^4.4 || ^5.0",
"symfony/phpunit-bridge": "^5.0",
"zendframework/zend-code": "^3.4"
},
"autoload": {
Expand All @@ -49,9 +49,18 @@
},
"autoload-dev": {
"psr-4": {
"CoopTilleuls\\MigrationBundle\\Tests\\": "features/app"
"CoopTilleuls\\MigrationBundle\\Tests\\": "features/app",
"PHPUnit\\": "vendor/bin/.phpunit/phpunit-8.3-0/src"
}
},
"scripts": {
"post-install-cmd": [
"vendor/bin/simple-phpunit --version"
],
"post-update-cmd": [
"vendor/bin/simple-phpunit --version"
]
},
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
Expand Down
11 changes: 6 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.6/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="features/app/bootstrap.php">
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="features/app/bootstrap.php">
<php>
<ini name="error_reporting" value="-1" />
<env name="SYMFONY_PHPUNIT_REMOVE" value="symfony/yaml" />
</php>

<testsuites>
<testsuite name="CoopTilleulsMigrationBundle tests suite">
Expand Down
Loading

0 comments on commit b7c641f

Please sign in to comment.