Merge branch 'main' of ssh://git.grey.ooo:222/Benzine/Github-Actions-Setup-PHP
This commit is contained in:
commit
6edc4dad35
4 changed files with 64 additions and 13 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -49,7 +49,7 @@ jobs:
|
||||||
echo "Composer is not available"
|
echo "Composer is not available"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# PHP Version is equal to 7.4
|
# PHP Version is equal to 7.4
|
||||||
if [ "$(php -r 'echo PHP_VERSION_ID;')" -gte 70400 && "$(php -r 'echo PHP_VERSION_ID;')" -lt 70500 ]; then
|
if [ "$(php -r 'echo PHP_VERSION_ID;')" -gte 70400 && "$(php -r 'echo PHP_VERSION_ID;')" -lt 70500 ]; then
|
||||||
echo "PHP Version is not 7.4. Got $(php -r 'echo PHP_VERSION_ID;') instead of between 70400-70500"
|
echo "PHP Version is not 7.4. Got $(php -r 'echo PHP_VERSION_ID;') instead of between 70400-70500"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
47
.github/workflows/trunk.upgrade.yml
vendored
Normal file
47
.github/workflows/trunk.upgrade.yml
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
name: "Quality Control: Trunk Upgrade"
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- .trunk/trunk.yaml
|
||||||
|
- .github/workflows/trunk.upgrade.yml
|
||||||
|
schedule:
|
||||||
|
- cron: "0 11 * * 1" # 11am Tooling Monday
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
trunk-upgrade:
|
||||||
|
name: Upgrade Trunk
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # For trunk to create PRs
|
||||||
|
pull-requests: write # For trunk to create PRs
|
||||||
|
steps:
|
||||||
|
- name: "Setup PHP"
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: 8.3
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: "Trunk Upgrade"
|
||||||
|
uses: trunk-io/trunk-action/upgrade@v1
|
||||||
|
- name: "PR: Find Pull Request"
|
||||||
|
uses: juliangruber/find-pull-request-action@v1
|
||||||
|
id: find-pull-request
|
||||||
|
with:
|
||||||
|
labels: trunk
|
||||||
|
- name: "PR: Enable Pull Request Automerge"
|
||||||
|
continue-on-error: true
|
||||||
|
uses: peter-evans/enable-pull-request-automerge@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
pull-request-number: ${{ steps.find-pull-request.outputs.number }}
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
|
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
|
||||||
version: 0.1
|
version: 0.1
|
||||||
cli:
|
cli:
|
||||||
version: 1.22.1
|
version: 1.22.2
|
||||||
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
|
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
|
||||||
plugins:
|
plugins:
|
||||||
sources:
|
sources:
|
||||||
- id: trunk
|
- id: trunk
|
||||||
ref: v1.5.0
|
ref: v1.6.1
|
||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
|
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
|
||||||
runtimes:
|
runtimes:
|
||||||
|
|
@ -16,15 +16,19 @@ runtimes:
|
||||||
- python@3.10.8
|
- python@3.10.8
|
||||||
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
|
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
|
||||||
lint:
|
lint:
|
||||||
|
ignore:
|
||||||
|
- linters: [markdownlint]
|
||||||
|
paths:
|
||||||
|
- LICENCE.md
|
||||||
disabled:
|
disabled:
|
||||||
- git-diff-check
|
- git-diff-check
|
||||||
enabled:
|
enabled:
|
||||||
- actionlint@1.7.0
|
- actionlint@1.7.1
|
||||||
- checkov@3.2.95
|
- checkov@3.2.216
|
||||||
- markdownlint@0.40.0
|
- markdownlint@0.41.0
|
||||||
- prettier@3.2.5
|
- prettier@3.3.3
|
||||||
- trivy@0.51.1
|
- trivy@0.54.0
|
||||||
- trufflehog@3.76.3
|
- trufflehog@3.80.3
|
||||||
- yamllint@1.35.1
|
- yamllint@1.35.1
|
||||||
actions:
|
actions:
|
||||||
enabled:
|
enabled:
|
||||||
|
|
@ -34,4 +38,4 @@ actions:
|
||||||
- trunk-upgrade-available
|
- trunk-upgrade-available
|
||||||
tools:
|
tools:
|
||||||
enabled:
|
enabled:
|
||||||
- act@0.2.62
|
- act@0.2.64
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,15 @@ Sets up a PHP project with GitHub Actions, including detecting PHP version and r
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
## Inputs:
|
## Inputs
|
||||||
|
|
||||||
- `working_directory`: The directory to run the PHP setup in. Default: `.`.
|
- `working_directory`: The directory to run the PHP setup in. Default: `.`.
|
||||||
- `php_tools`: The PHP tools to install.
|
- `php_tools`: The PHP tools to install.
|
||||||
|
|
||||||
## Outputs:
|
## Outputs
|
||||||
|
|
||||||
- `php_version`: The PHP version that was detected.
|
- `php_version`: The PHP version that was detected.
|
||||||
|
|
||||||
## Exported Envs:
|
## Exported Envs
|
||||||
|
|
||||||
- `PHP_VERSION`: The PHP version that was detected.
|
- `PHP_VERSION`: The PHP version that was detected.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue