Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Synchronize with ergebnis/php-library-template #136

Merged
merged 1 commit into from
Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
22 changes: 14 additions & 8 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ branches:
- "Tests (7.4, highest)"
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 @@ -39,35 +45,35 @@ branches:

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

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

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

- name: "rfc"
color: "#f4db3a"
color: "f4db3a"
description: ""

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

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

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

- name: "vendor"
color: "#f4db3a"
color: "f4db3a"
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 @@ -27,10 +27,17 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
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.7.3"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
Expand All @@ -39,22 +46,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 @@ -65,7 +76,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 @@ -89,36 +100,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.7.3"
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://webfactory/composer-require-checker:2.0.0"
uses: "docker://webfactory/composer-require-checker:2.1.0"

static-code-analysis:
name: "Static Code Analysis"
Expand All @@ -135,37 +150,48 @@ jobs:

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

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@1.7.3"
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"

- name: "Create cache directory for phpstan/phpstan"
run: "mkdir -p .build/phpstan"

- name: "Cache cache directory for phpstan/phpstan"
uses: "actions/cache@v1"
with:
path: ".build/phpstan"
key: "php-${{ matrix.php-version }}-phpstan-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-phpstan-"

- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan analyse --configuration=phpstan.neon"

Expand Down Expand Up @@ -194,31 +220,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.7.3"
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
31 changes: 31 additions & 0 deletions .github/workflows/prune.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# https://github.com/actions/stale

name: "Prune"

on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 12 * * *"

jobs:
prune:
name: "Issues"

runs-on: "ubuntu-latest"

steps:
- name: "Prune issues and pull requests"
uses: "actions/stale@v1"
with:
days-before-close: 5
days-before-stale: 60
repo-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
stale-issue-label: "stale"
stale-issue-message: |
Since this issue has not had any activity within the last sixty days, I have marked it as stale.

I will close it if no further activity occurs within the next five days.
stale-pr-label: "stale"
stale-pr-message: |
Since this pull request has not had any activity within the last sixty days, I have marked it as stale.

I will close it if no further activity occurs within the next five days.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Continuous Deployment"
name: "Release"

on:
on: # yamllint disable-line rule:truthy
push:
tags:
- "**"
Expand All @@ -19,7 +19,7 @@ jobs:
run: "echo \"::set-output name=tag::${GITHUB_REF#refs/tags/}\""

- name: "Create release"
uses: "actions/create-release@v1.0.0"
uses: "actions/create-release@v1"
env:
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
with:
Expand Down
Loading