initial commit.

This commit is contained in:
Greyscale 2024-05-18 17:22:19 +02:00
parent bb745e6fea
commit cf90ea7eca
3 changed files with 235 additions and 164 deletions

22
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,22 @@
# Code of Conduct
This code of conduct outlines our expectations for participants within the open source community. Anyone who violates this code of conduct may be banned from contributing here.
## Requirements
- **Be friendly and patient.**
- **Be welcoming** _We strive to be a community that welcomes and supports people of all backgrounds and identities._
- **Be respectful** _Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners._
## Unacceptable Behaviour
- Offensive comments related to gender, sexual orientation, disability, mental illness, physical appearance, body size, race, age, regional discrimination, political or religious affiliation.
- Threats of violence, both physical and psycological.
- Incitement of violence towards any individual, including encouraging a person to commit suicide or to engage in self-harm.
- Continued communication after requests to cease.
## Interactions
- Don't just tell somebody they are wrong, or what they have done is wrong. You must always explain what is wrong, and why it is wrong.
- Don't reject contributions that are partially complete and then go and commit your own version. Try to work with the author to complete their work.
- We encourage everyone to participate and are committed to building a community for all, we seek to treat everyone both as fairly and equally as possible.

View file

49
action.yml Normal file
View file

@ -0,0 +1,49 @@
name: "Setup PHP Project"
description: "Sets up a PHP project with GitHub Actions, including detecting PHP version and running composer install."
inputs:
working_directory:
description: "The directory where the project is located."
required: false
default: "."
php_tools:
description: "The PHP tools to install. Comma seperated list from shivammathur/setup-php"
required: false
default: ""
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- id: datetime
uses: ./.github/composite-actions/get-datetime
- id: read-php-version
shell: bash
working-directory: ${{ inputs.working_directory }}
run: echo "php_version=$(jq -r '.require["php"]' composer.json | sed -E 's/[^0-9.]//g')" >> $GITHUB_OUTPUT
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ steps.read-php-version.outputs.php_version }}
tools: ${{ inputs.php_tools }}
- id: composer-cache-find
shell: bash
run: |
{
echo "dir=$(composer config cache-files-dir)"
echo "key=${{ runner.os }}-${{ inputs.working_directory }}-composer-${{ hashFiles('${{ inputs.working_directory }}/composer.lock') }}"
echo "restore-key=${{ runner.os }}-${{ inputs.working_directory }}-composer-"
} >> $GITHUB_OUTPUT
- id: composer-cache-restore
uses: actions/cache/restore@v4
with:
path: ${{ steps.composer-cache-find.outputs.dir }}
key: ${{ steps.composer-cache-find.outputs.key
restore-keys: ${{ steps.composer-cache-find.outputs.restore-key }}
- working-directory: ${{ inputs.working_directory }}
shell: bash
run: composer install --ignore-platform-reqs --prefer-dist
- id: composer-cache-save
uses: actions/cache/save@v4
with:
path: ${{ steps.composer-cache-find.outputs.dir }}
key: ${{ steps.composer-cache-find.outputs.key }}