From efcd26fb517b220e7b879a9750d760ab459af4d3 Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Sun, 14 Apr 2024 18:50:37 +0200 Subject: [PATCH] Initial commit again --- .github/workflows/test.yml | 50 +++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- .trunk/.gitignore | 9 +++++++ .trunk/configs/.yamllint.yaml | 7 +++++ .trunk/trunk.yaml | 32 ++++++++++++++++++++++ 5 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml create mode 100644 .trunk/.gitignore create mode 100644 .trunk/configs/.yamllint.yaml create mode 100644 .trunk/trunk.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ea60dba --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,50 @@ +name: Tests + +on: + push: + workflow_dispatch: + pull_request: + +concurrency: + group: tests-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + ACTION_TOKEN: ${{ github.token }} + +jobs: + phpcsfixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: PHP-CS-Fixer + uses: docker://oskarstark/php-cs-fixer-ga + + phpunit: + name: PHPUnit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: php-actions/composer@v6 + - uses: php-actions/phpunit@v3 + + phpstan: + name: PHPStan + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: php-actions/composer@v6 + - uses: php-actions/phpstan@v3 + with: + path: src/ + + trunk: + name: Trunk Check Runner + runs-on: ubuntu-latest + permissions: + checks: write # For trunk to post annotations + + steps: + - uses: actions/checkout@v3 + - uses: trunk-io/trunk-action@v1 diff --git a/.gitignore b/.gitignore index f45219c..cc21be5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor/ -/.idea \ No newline at end of file +/.idea +/.github/act.secrets \ No newline at end of file diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 0000000..15966d0 --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1,9 @@ +*out +*logs +*actions +*notifications +*tools +plugins +user_trunk.yaml +user.yaml +tmp diff --git a/.trunk/configs/.yamllint.yaml b/.trunk/configs/.yamllint.yaml new file mode 100644 index 0000000..184e251 --- /dev/null +++ b/.trunk/configs/.yamllint.yaml @@ -0,0 +1,7 @@ +rules: + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 0000000..510ed6d --- /dev/null +++ b/.trunk/trunk.yaml @@ -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: + - actionlint@1.6.27 + - checkov@3.2.60 + - git-diff-check + - 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