Skip to content

Commit

Permalink
Merge pull request #203 from ergebnis/feature/synchronize
Browse files Browse the repository at this point in the history
Enhancement: Synchronize with ergebnis/php-library-template
  • Loading branch information
localheinz authored Mar 13, 2020
2 parents 82dca51 + 5b7abec commit 72eeba4
Show file tree
Hide file tree
Showing 17 changed files with 258 additions and 95 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ indent_size = 2
[*.neon]
indent_style = tab

[*.yml]
[*.{yaml,yml}]
indent_size = 2

[Makefile]
Expand Down
9 changes: 7 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

We are using [GitHub Actions](https://github.com/features/actions) as a continuous integration system.

For details, see [`workflows/continuous-integration.yml`](workflows/continuous-integration.yml).
For details, take a look at the following workflow configuration files:

- [`workflows/integrate.yaml`](workflows/integrate.yaml)
- [`workflows/prune.yaml`](workflows/prune.yaml)
- [`workflows/release.yaml`](workflows/release.yaml)
- [`workflows/renew.yaml`](workflows/renew.yaml)

## Coding Standards

Expand Down Expand Up @@ -40,7 +45,7 @@ $ make static-code-analysis

to run a static code analysis.

We are also using the baseline features of [`phpstan/phpstan`(https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).
We are also using the baseline features of [`phpstan/phpstan`](https://medium.com/@ondrejmirtes/phpstans-baseline-feature-lets-you-hold-new-code-to-a-higher-standard-e77d815a5dff) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).

Run

Expand Down
18 changes: 12 additions & 6 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ branches:
- "codecov/project"
strict: false
restrictions:

# https://developer.github.com/v3/repos/branches/#parameters-1

# Note: User, app, and team restrictions are only available for organization-owned repositories.
# Set to null to disable when using this configuration for a repository on a personal account.

apps:
- "dependabot-preview"
teams: []
Expand All @@ -46,27 +52,27 @@ branches:

labels:
- name: "bug"
color: "#ee0701"
color: "ee0701"
description: ""

- name: "dependency"
color: "#0366d6"
color: "0366d6"
description: ""

- name: "enhancement"
color: "#0e8a16"
color: "0e8a16"
description: ""

- name: "question"
color: "#cc317c"
color: "cc317c"
description: ""

- name: "security"
color: "#ee0701"
color: "ee0701"
description: ""

- name: "stale"
color: "#eeeeee"
color: "eeeeee"
description: ""

# https://developer.github.com/v3/repos/#edit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Continuous Integration"
name: "Integrate"

on:
pull_request:
on: # yamllint disable-line rule:truthy
pull_request: null
push:
branches:
- "master"
Expand All @@ -29,10 +29,17 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/[email protected]"
uses: "actions/checkout@v2"

- name: "Lint YAML files"
uses: "ibiqlik/action-yamllint@v1"
with:
config_file: ".yamllint.yaml"
file_or_dir: "."
strict: true

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand All @@ -41,22 +48,26 @@ jobs:
- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies with composer"
- name: "Install lowest dependencies from composer.json"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies with composer"
- name: "Install locked dependencies from composer.lock"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies with composer"
- name: "Install highest dependencies from composer.json"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

Expand All @@ -67,7 +78,7 @@ jobs:
run: "mkdir -p .build/php-cs-fixer"

- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: ".build/php-cs-fixer"
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('**/composer.lock') }}"
Expand All @@ -91,36 +102,40 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
uses: "actions/checkout@v2"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies with composer"
- name: "Install lowest dependencies from composer.json"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies with composer"
- name: "Install locked dependencies from composer.lock"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies with composer"
- name: "Install highest dependencies from composer.json"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Run maglnet/composer-require-checker"
uses: "docker://localheinz/composer-require-checker-action:1.1.1"
uses: "docker://webfactory/composer-require-checker:2.1.0"

static-code-analysis:
name: "Static Code Analysis"
Expand All @@ -137,31 +152,35 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
uses: "actions/checkout@v2"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.lock') }}"
restore-keys: "${{ matrix.php-version }}-composer-locked-"

- name: "Install lowest dependencies with composer"
- name: "Install lowest dependencies from composer.json"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies with composer"
- name: "Install locked dependencies from composer.lock"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies with composer"
- name: "Install highest dependencies from composer.json"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

Expand Down Expand Up @@ -197,31 +216,35 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
uses: "actions/checkout@v2"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies with composer"
- name: "Install lowest dependencies from composer.json"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies with composer"
- name: "Install locked dependencies from composer.lock"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies with composer"
- name: "Install highest dependencies from composer.json"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

Expand Down Expand Up @@ -249,31 +272,35 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
uses: "actions/checkout@v2"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies with composer"
- name: "Install lowest dependencies from composer.json"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies with composer"
- name: "Install locked dependencies from composer.lock"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies with composer"
- name: "Install highest dependencies from composer.json"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

Expand Down Expand Up @@ -303,31 +330,35 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
uses: "actions/checkout@v2"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install lowest dependencies with composer"
- name: "Install lowest dependencies from composer.json"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies with composer"
- name: "Install locked dependencies from composer.lock"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies with composer"
- name: "Install highest dependencies from composer.json"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

Expand Down
Loading

0 comments on commit 72eeba4

Please sign in to comment.