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 #528

Merged
merged 1 commit into from
Aug 28, 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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/.dependabot/ export-ignore
/.github/ export-ignore
/bin/ export-ignore
/phar/ export-ignore
Expand Down
16 changes: 8 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We are using [`yamllint`](https://github.com/adrienverge/yamllint) to enforce co

If you do not have `yamllint` installed yet, run

```
```sh
$ brew install yamllint
```

Expand All @@ -29,7 +29,7 @@ We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-C

Run

```
```sh
$ make coding-standards
```

Expand All @@ -41,7 +41,7 @@ We are using [`maglnet/composer-require-checker`](https://github.com/maglnet/Com

Run

```
```sh
$ make dependency-analysis
```

Expand All @@ -53,7 +53,7 @@ We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo

Run

```
```sh
$ make static-code-analysis
```

Expand All @@ -63,7 +63,7 @@ We are also using the baseline features of [`phpstan/phpstan`](https://medium.co

Run

```
```sh
$ make static-code-analysis-baseline
```

Expand All @@ -77,7 +77,7 @@ We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) t

Run

```
```sh
$ make tests
```

Expand All @@ -87,7 +87,7 @@ to run all the tests.

Run

```
```sh
$ make
```

Expand All @@ -97,7 +97,7 @@ to enforce coding standards, run a static code analysis, and run tests!

:bulb: Run

```
```sh
$ make help
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions
# https://getcomposer.org/doc/03-cli.md#composer-cache-dir

name: "Determine composer cache directory"

description: "Determines the composer cache directory and exports it as COMPOSER_CACHE_DIR environment variable"

runs:
using: "composite"

steps:
- name: "Determine composer cache directory"
shell: "bash"
run: "echo \"::set-env name=COMPOSER_CACHE_DIR::$(composer config cache-dir)\""
22 changes: 22 additions & 0 deletions .github/actions/composer/composer/install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions

name: "Install dependencies with composer"

description: "Installs dependencies with composer"

inputs:
dependencies:
description: "Which dependencies to install, one of \"lowest\", \"locked\", \"highest\""
required: true

runs:
using: "composite"

steps:
- name: "Install ${{ inputs.dependencies }} dependencies with composer"
shell: "bash"
run: "${{ github.action_path }}/run.sh"
env:
COMPOSER_INSTALL_DEPENDENCIES: "${{ inputs.dependencies }}"
25 changes: 25 additions & 0 deletions .github/actions/composer/composer/install/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

dependencies="${COMPOSER_INSTALL_DEPENDENCIES}"

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

exit 0
fi

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

exit 0
fi

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

exit 0
fi

echo "::error::The value for the \"dependencies\" input needs to be one of \"lowest\", \"locked\"', \"highest\"' - got \"${dependencies}\" instead."

exit 1
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
# https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2

Expand Down
14 changes: 7 additions & 7 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
branches:
- name: "main"

# https://developer.github.com/v3/repos/branches/#remove-branch-protection
# https://developer.github.com/v3/repos/branches/#update-branch-protection
# https://docs.github.com/en/rest/reference/repos#delete-branch-protection
# https://docs.github.com/en/rest/reference/repos#update-branch-protection

protection:
enforce_admins: false
Expand Down Expand Up @@ -50,7 +50,7 @@ branches:
strict: false
restrictions:

# https://developer.github.com/v3/repos/branches/#parameters-1
# https://docs.github.com/en/rest/reference/repos#list-branches--parameters

# 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.
Expand All @@ -60,8 +60,8 @@ branches:
users:
- "ergebnis-bot"

# https://developer.github.com/v3/issues/labels/#create-a-label
# https://developer.github.com/v3/issues/labels/#update-a-label
# https://docs.github.com/en/rest/reference/issues#create-a-label
# https://docs.github.com/en/rest/reference/issues#update-a-label

labels:
- name: "bug"
Expand Down Expand Up @@ -92,7 +92,7 @@ labels:
color: "eeeeee"
description: ""

# https://developer.github.com/v3/repos/#edit
# https://docs.github.com/en/rest/reference/repos#update-a-repository

repository:
allow_merge_commit: true
Expand All @@ -110,6 +110,6 @@ repository:
name: "composer-normalize"
private: false

# https://developer.github.com/v3/repos/branches/#remove-branch-protection
# https://docs.github.com/en/rest/reference/repos#replace-all-repository-topics

topics: "composer, composer-plugin, json, normalizer"
Loading