Trunk things

This commit is contained in:
Greyscale 2024-04-14 15:49:43 +02:00
parent a3b9a49fec
commit e0cddd9ce8
7 changed files with 221 additions and 119 deletions

24
.github/workflows/cache_trunk.yaml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Cache Trunk
on:
push:
branches: [main]
paths: [.trunk/trunk.yaml]
permissions: read-all
jobs:
cache_trunk:
name: Cache Trunk
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Trunk Check
uses: ./ # external users, use: trunk-io/trunk-action@v1
with:
check-mode: populate_cache_only

33
.github/workflows/pr.yaml vendored Normal file
View file

@ -0,0 +1,33 @@
name: Pull Request
on: [pull_request, workflow_dispatch]
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: read-all
jobs:
trunk_check:
name: Trunk Check Runner
runs-on: ubuntu-latest
permissions:
checks: write # For trunk to post annotations
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Trunk Check
uses: ./ # external users, use: trunk-io/trunk-action@v1
action_tests:
name: Action tests
uses: ./.github/workflows/action_tests.yaml
repo_tests:
name: Repository tests
uses: ./.github/workflows/repo_tests.yaml
docker_repo_tests:
name: Repository tests (docker)
uses: ./.github/workflows/docker_repo_tests.yaml

9
.trunk/.gitignore vendored Normal file
View file

@ -0,0 +1,9 @@
*out
*logs
*actions
*notifications
*tools
plugins
user_trunk.yaml
user.yaml
tmp

View file

@ -0,0 +1,2 @@
# Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier

View file

@ -0,0 +1,7 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
key-duplicates: {}
octal-values:
forbid-implicit-octal: true

32
.trunk/trunk.yaml Normal file
View file

@ -0,0 +1,32 @@
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
version: 0.1
cli:
version: 1.21.0
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
plugins:
sources:
- id: trunk
ref: v1.4.5
uri: https://github.com/trunk-io/plugins
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
runtimes:
enabled:
- node@18.12.1
- python@3.10.8
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
lint:
enabled:
- checkov@3.2.60
- git-diff-check
- markdownlint@0.39.0
- prettier@3.2.5
- trivy@0.50.1
- trufflehog@3.71.0
- yamllint@1.35.1
actions:
enabled:
- trunk-announce
- trunk-check-pre-push
- trunk-fmt-pre-commit
- trunk-upgrade-available

View file

@ -1,122 +1,117 @@
{
"name": "benzine/core",
"description": "The core nugget.",
"type": "library",
"license": "GPL-3.0-or-later",
"authors": [
{
"name": "Matthew Baggett",
"email": "matthew@baggett.me"
}
],
"config": {
"sort-packages": true
},
"require": {
"php": ">=8.0",
"ext-apcu": "*",
"ext-curl": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-redis": "*",
"ext-reflection": "*",
"ext-simplexml": "*",
"ext-sockets": "*",
"ext-zip": "*",
"bjeavons/zxcvbn-php": "^1.0",
"brainmaestro/composer-git-hooks": "^2.8",
"bramus/monolog-colored-line-formatter": "~3.0",
"cache/apc-adapter": "^1.0",
"cache/apcu-adapter": "^1.0",
"cache/array-adapter": "^1.0",
"cache/chain-adapter": "^1.0",
"cache/redis-adapter": "^1.0",
"cocur/slugify": "^4.0",
"doctrine/annotations": "^1.10",
"donatj/flags": "^1.4",
"fakerphp/faker": "^1.14.1",
"friendsofphp/php-cs-fixer": "^3.0",
"kint-php/kint": "^4.0",
"kint-php/kint-twig": "^4.0",
"matthewbaggett/inflection": "^2.1",
"matthewbaggett/uuid": "^2.3",
"mattketmo/camel": "^1.1",
"maximebf/debugbar": "^1.16",
"middlewares/content-length": "^2.0",
"middlewares/debugbar": "^2.0",
"middlewares/encoder": "^2.1",
"middlewares/geolocation": "^3.0",
"middlewares/payload": "^3.0",
"middlewares/response-time": "^2.0",
"middlewares/trailing-slash": "^2.0",
"middlewares/whoops": "^2.0",
"monolog/monolog": "^2.1",
"php-di/slim-bridge": "^3.0",
"php-webdriver/webdriver": "^1.6",
"psr/cache": "^1.0",
"psr/container": "^1.0",
"psr/simple-cache": "^1.0",
"slim/http-cache": "^1.0",
"slim/psr7": "^1.1",
"slim/slim": "^4.5",
"slim/twig-view": "^3.2",
"squizlabs/php_codesniffer": "3.*",
"swaggest/json-schema": "^0.12.39",
"symfony/translation": "^5.1",
"symfony/twig-bridge": "^5.1",
"symfony/yaml": "^5.1",
"tuupola/server-timing-middleware": "^0.9",
"twig/extra-bundle": "^3",
"twig/intl-extra": "^3.0",
"twig/twig": "^3.0"
},
"require-dev": {
"benzine/orm": "dev-master",
"brianium/paratest": "^6.0",
"clue/commander": "^v1.3.0",
"jc21/clitable": "^1.2",
"johnkary/phpunit-speedtrap": "^3.0.0",
"php-coveralls/php-coveralls": "^2.1",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-deprecation-rules": "^0.12",
"phpstan/phpstan-phpunit": "^0.12.16",
"phpstan/phpstan-symfony": "^0.12",
"phpunit/phpunit": "^9.2",
"slam/phpstan-extensions": "^5.0",
"thecodingmachine/phpstan-strict-rules": "^0.12",
"wyrihaximus/html-compress": "^4.1"
},
"suggest": {
"benzine/orm" : "Model/Service/Crud generation made easy"
},
"autoload": {
"psr-4": {
"Benzine\\": "src",
"Benzine\\Tests\\": "tests/"
}
},
"bin": [
"bin/queue-status",
"bin/queue-view-item",
"bin/worker"
],
"extra": {
"hooks": {
"pre-commit": [
"echo committing as $(git config user.name)",
"docker run --rm -i -v $(pwd):/app cytopia/php-cs-fixer:latest fix /app"
],
"pre-push": [
"composer install",
"docker run --rm -i -v $(pwd):/app cytopia/php-cs-fixer:latest fix /app",
"vendor/bin/phpstan analyse"
],
"post-merge": "composer install --ignore-platform-reqs"
}
},
"scripts": {
"post-install-cmd": "cghooks add --ignore-lock",
"post-update-cmd": "cghooks update"
"name": "benzine/core",
"description": "The core nugget.",
"type": "library",
"license": "GPL-3.0-or-later",
"authors": [
{
"name": "Matthew Baggett",
"email": "matthew@baggett.me"
}
],
"config": {
"sort-packages": true
},
"require": {
"php": ">=8.0",
"ext-apcu": "*",
"ext-curl": "*",
"ext-iconv": "*",
"ext-json": "*",
"ext-openssl": "*",
"ext-redis": "*",
"ext-reflection": "*",
"ext-simplexml": "*",
"ext-sockets": "*",
"ext-zip": "*",
"bjeavons/zxcvbn-php": "^1.0",
"bramus/monolog-colored-line-formatter": "~3.1",
"cache/apc-adapter": "^1.0",
"cache/apcu-adapter": "^1.0",
"cache/array-adapter": "^1.0",
"cache/chain-adapter": "^1.0",
"cache/redis-adapter": "^1.0",
"cocur/slugify": "^4.0",
"doctrine/annotations": "^1.10",
"donatj/flags": "^1.4",
"fakerphp/faker": "^1.14.1",
"friendsofphp/php-cs-fixer": "^3.0",
"kint-php/kint": "^4.0",
"kint-php/kint-twig": "^4.0",
"matthewbaggett/inflection": "^2.1",
"matthewbaggett/uuid": "^2.3",
"mattketmo/camel": "^1.1",
"maximebf/debugbar": "^1.16",
"middlewares/content-length": "^2.0",
"middlewares/debugbar": "^2.0",
"middlewares/encoder": "^2.1",
"middlewares/geolocation": "^3.0",
"middlewares/payload": "^3.0",
"middlewares/response-time": "^2.0",
"middlewares/trailing-slash": "^2.0",
"middlewares/whoops": "^2.0",
"monolog/monolog": "^3.6",
"php-di/slim-bridge": "^3.0",
"php-webdriver/webdriver": "^1.6",
"psr/cache": "^1.0",
"psr/container": "^1.0",
"psr/simple-cache": "^1.0",
"slim/http-cache": "^1.0",
"slim/psr7": "^1.1",
"slim/slim": "^4.5",
"slim/twig-view": "^3.2",
"squizlabs/php_codesniffer": "3.*",
"swaggest/json-schema": "^0.12.39",
"symfony/translation": "^5.1",
"symfony/twig-bridge": "^5.1",
"symfony/yaml": "^5.1",
"tuupola/server-timing-middleware": "^0.9",
"twig/extra-bundle": "^3",
"twig/intl-extra": "^3.0",
"twig/twig": "^3.0"
},
"require-dev": {
"benzine/orm": "dev-main",
"brianium/paratest": "^7",
"clue/commander": "^v1.3.0",
"ergebnis/phpunit-slow-test-detector": "^2.1",
"jc21/clitable": "^1.2",
"php-coveralls/php-coveralls": "^2.1",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-deprecation-rules": "^0.12",
"phpstan/phpstan-phpunit": "^0.12.16",
"phpstan/phpstan-symfony": "^0.12",
"phpunit/phpunit": "^10",
"slam/phpstan-extensions": "^5.0",
"thecodingmachine/phpstan-strict-rules": "^0.12",
"wyrihaximus/html-compress": "^4.1"
},
"suggest": {
"benzine/orm": "Model/Service/Crud generation made easy"
},
"autoload": {
"psr-4": {
"Benzine\\": "src",
"Benzine\\Tests\\": "tests/"
}
},
"bin": [
"bin/queue-status",
"bin/queue-view-item",
"bin/worker"
],
"extra": {
"hooks": {
"pre-commit": [
"echo committing as $(git config user.name)",
"docker run --rm -i -v $(pwd):/app cytopia/php-cs-fixer:latest fix /app"
],
"pre-push": [
"composer install",
"docker run --rm -i -v $(pwd):/app cytopia/php-cs-fixer:latest fix /app",
"vendor/bin/phpstan analyse"
],
"post-merge": "composer install --ignore-platform-reqs"
}
}
}