Skip to content

Commit

Permalink
Merge pull request #204 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
ergebnis-bot authored Aug 30, 2020
2 parents b663ff4 + 5dfea8a commit e4190da
Show file tree
Hide file tree
Showing 11 changed files with 201 additions and 162 deletions.
29 changes: 15 additions & 14 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/.github/ export-ignore
/test/ export-ignore
/tools/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/infection.json export-ignore
/Makefile export-ignore
/phive.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/.github/ export-ignore
/test/ export-ignore
/tools/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/composer-require-checker.json export-ignore
/infection.json export-ignore
/Makefile export-ignore
/phive.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
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
Loading

0 comments on commit e4190da

Please sign in to comment.