From 3dcec52640139ef44a658852f958c4e1c583134c Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Fri, 7 Mar 2025 10:55:04 +0100 Subject: [PATCH] ci: streamline with lib --- .github/workflows/pipeline.yml | 11 ++++++++ Makefile | 46 +++++++++++++++++++++++----------- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index bf67464..af09239 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -1,6 +1,10 @@ name: pipeline on: pull_request +permissions: + contents: read + pull-requests: write + jobs: tests: runs-on: ubuntu-latest @@ -37,6 +41,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Conventional Commit + uses: ytanikin/pr-conventional-commits@1.4.1 + with: + task_types: '["feat", "fix", "docs", "test", "ci", "style", "refactor", "perf", "chore", "revert"]' + add_label: 'true' + custom_labels: '{"feat": "feature", "fix": "bug", "docs": "documentation", "test": "test", "ci": "CI/CD", "style": "codestyle", "refactor": "refactor", "perf": "performance", "chore": "chore", "revert": "revert"}' + - name: Setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/Makefile b/Makefile index 11fde22..73a44fa 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,39 @@ -qa: - composer update --prefer-stable - PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix - vendor/bin/phpstan - vendor/bin/phpunit +.PHONY: deps-stable deps-low cs rector phpstan tests coverage run-examples ci ci-stable ci-lowest -qa-lowest: - composer update --prefer-lowest - PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix - vendor/bin/phpstan - vendor/bin/phpunit +deps-stable: + composer update --prefer-stable --ignore-platform-req=ext-mongodb -qa-dev: +deps-low: + composer update --prefer-lowest --ignore-platform-req=ext-mongodb + +deps-dev: composer require php-llm/llm-chain:dev-main - PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix - vendor/bin/phpstan + +cs: + PHP_CS_FIXER_IGNORE_ENV=true vendor/bin/php-cs-fixer fix --diff --verbose + +rector: + vendor/bin/rector + +phpstan: + vendor/bin/phpstan --memory-limit=-1 + +tests: vendor/bin/phpunit - # revert + +coverage: + XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage + +run-examples: + ./example + +ci: ci-stable + +ci-stable: deps-stable rector cs phpstan tests + +ci-lowest: deps-low rector cs phpstan tests + +ci-dev: deps-dev rector cs phpstan tests git restore composer.json coverage: