Skip to content

Commit

Permalink
Merge pull request #244 from Lctrs/feature/sync
Browse files Browse the repository at this point in the history
sync with skeleton
  • Loading branch information
Lctrs committed Apr 7, 2021
2 parents 8f1cb3b + 5eda5c8 commit efe5ec3
Show file tree
Hide file tree
Showing 18 changed files with 3,721 additions and 727 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Expand Up @@ -49,7 +49,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://phpstan.org/user-guide/baseline) and [`vimeo/psalm`](https://psalm.dev/docs/running_psalm/dealing_with_code_issues/#using-a-baseline-file).

Run

Expand Down
5 changes: 5 additions & 0 deletions .github/actions/composer/composer/install/action.yaml
Expand Up @@ -10,6 +10,10 @@ inputs:
dependencies:
description: "Which dependencies to install, one of \"lowest\", \"locked\", \"highest\""
required: true
working-directory:
default: "."
description: "Directory in which composer will run, defaults to current directory"
required: false

runs:
using: "composite"
Expand All @@ -20,3 +24,4 @@ runs:
run: "${{ github.action_path }}/run.sh"
env:
COMPOSER_INSTALL_DEPENDENCIES: "${{ inputs.dependencies }}"
COMPOSER_WORKING_DIRECTORY: "${{ inputs.working-directory }}"
7 changes: 4 additions & 3 deletions .github/actions/composer/composer/install/run.sh
@@ -1,21 +1,22 @@
#!/usr/bin/env bash

dependencies="${COMPOSER_INSTALL_DEPENDENCIES}"
working_directory="${COMPOSER_WORKING_DIRECTORY}"

if [[ ${dependencies} == "lowest" ]]; then
composer update --no-interaction --no-progress --prefer-lowest
composer update --no-interaction --no-progress --prefer-lowest --working-dir="${working_directory}"

exit $?
fi

if [[ ${dependencies} == "locked" ]]; then
composer install --no-interaction --no-progress
composer install --no-interaction --no-progress --working-dir="${working_directory}"

exit $?
fi

if [[ ${dependencies} == "highest" ]]; then
composer update --no-interaction --no-progress
composer update --no-interaction --no-progress --working-dir="${working_directory}"

exit $?
fi
Expand Down
24 changes: 24 additions & 0 deletions .github/dependabot.yaml
Expand Up @@ -3,6 +3,30 @@
version: 2

updates:
- commit-message:
include: "scope"
prefix: "composer"
directory: "/.tools/composer-require-checker"
labels:
- "dependency"
open-pull-requests-limit: 10
package-ecosystem: "composer"
schedule:
interval: "daily"
versioning-strategy: "increase"

- commit-message:
include: "scope"
prefix: "composer"
directory: "/.tools/infection"
labels:
- "dependency"
open-pull-requests-limit: 10
package-ecosystem: "composer"
schedule:
interval: "daily"
versioning-strategy: "increase"

- commit-message:
include: "scope"
prefix: "composer"
Expand Down
2 changes: 1 addition & 1 deletion .github/settings.yml
Expand Up @@ -16,7 +16,7 @@ branches:
contexts:
- "Code Coverage (8.0, locked)"
- "Coding Standards (8.0, locked)"
- "Dependency Analysis (7.4, locked)"
- "Dependency Analysis (8.0, locked)"
- "Mutation Tests (8.0, locked)"
- "Static Code Analysis (8.0, locked)"
- "Tests (7.3, highest)"
Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/integrate.yaml
Expand Up @@ -85,7 +85,7 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.0"

dependencies:
- "locked"
Expand All @@ -100,7 +100,6 @@ jobs:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: "phive"

- name: "Determine composer cache directory"
uses: "./.github/actions/composer/composer/determine-cache-directory"
Expand All @@ -109,19 +108,22 @@ jobs:
uses: "actions/cache@v2.1.4"
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock', '.tools/composer-require-checker/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Install tools with phive"
run: "phive --no-progress install --trust-gpg-keys D2CCAC42F6295E7D"
- name: "Install maglnet/composer-require-checker with composer"
uses: "./.github/actions/composer/composer/install"
with:
dependencies: "${{ matrix.dependencies }}"
working-directory: ".tools/composer-require-checker/"

- name: "Run maglnet/composer-require-checker"
run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"
run: ".tools/composer-require-checker/vendor/bin/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"

static-code-analysis:
name: "Static Code Analysis"
Expand Down Expand Up @@ -263,7 +265,7 @@ jobs:
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.10.0"
with:
coverage: "pcov"
coverage: "xdebug"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

Expand All @@ -285,7 +287,7 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Collect code coverage with pcov and phpunit/phpunit"
- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml.dist --coverage-clover=.build/phpunit/logs/clover.xml"

- name: "Send code coverage report to Codecov.io"
Expand Down Expand Up @@ -313,7 +315,7 @@ jobs:
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.10.0"
with:
coverage: "pcov"
coverage: "xdebug"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

Expand All @@ -324,16 +326,24 @@ jobs:
uses: "actions/cache@v2.1.4"
with:
path: "${{ env.COMPOSER_CACHE_DIR }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock', '.tools/infection/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run mutation tests with pcov and infection/infection"
run: "vendor/bin/infection --configuration=infection.json.dist"
- name: "Install infection/infection with composer"
uses: "./.github/actions/composer/composer/install"
with:
dependencies: "${{ matrix.dependencies }}"
working-directory: ".tools/infection/"

- name: "Run mutation tests with Xdebug and infection/infection"
run: ".tools/infection/vendor/bin/infection --configuration=infection.json.dist"
env:
STRYKER_DASHBOARD_API_KEY: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"

merge:
name: "Merge"
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
@@ -1,6 +1,5 @@
/.build/
/.phive/*
!/.phive/phars.xml
/.tools/*/vendor/
/test/*/phpunit.xml
/vendor/
/codeception.yml
Expand Down
4 changes: 0 additions & 4 deletions .phive/phars.xml

This file was deleted.

6 changes: 6 additions & 0 deletions .tools/composer-require-checker/composer.json
@@ -0,0 +1,6 @@
{
"require": {
"php": "^7.4.0 || ^8.0.0",
"maglnet/composer-require-checker": "3.2.0"
}
}

0 comments on commit efe5ec3

Please sign in to comment.