From f7a40f9b4a00408595de96b6ac241b51e562bbf9 Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Tue, 21 Nov 2023 22:17:39 +0100 Subject: [PATCH] Add badges for workflows --- .github/dependabot.yml | 1 - .github/workflows/phpmd.yml | 8 +++----- .github/workflows/phpstan.yml | 17 +++++++++++++---- README.md | 3 +++ 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index af1b88c..33f1a33 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,7 +7,6 @@ updates: assignees: - "sebastian-meyer" labels: [ ] - - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/phpmd.yml b/.github/workflows/phpmd.yml index b949d38..d3b3cef 100644 --- a/.github/workflows/phpmd.yml +++ b/.github/workflows/phpmd.yml @@ -1,19 +1,17 @@ -name: PHPMD +name: PHP Mess Detector on: push: branches: [ "main" ] pull_request: branches: [ "main" ] - schedule: - - cron: '00 03 * * 1' permissions: contents: read jobs: PHPMD: - name: Run PHPMD Scanning + name: Run PHPMD Scanner runs-on: ubuntu-latest permissions: contents: read @@ -27,7 +25,7 @@ jobs: - name: Setup Environment uses: shivammathur/setup-php@v2 with: - php-version: '8.0' + php-version: "8.0" coverage: none tools: phpmd diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index d87c436..8752478 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -1,4 +1,4 @@ -name: PHPStan +name: PHP Static Analyzer on: push: @@ -6,20 +6,29 @@ on: pull_request: branches: [ "main" ] +permissions: + contents: read + jobs: - phpstan: + PHPStan: + name: Run PHPStan Scanner runs-on: ubuntu-latest + permissions: + contents: read + security-events: write + actions: read + steps: - name: Checkout Source Code uses: actions/checkout@v4 - - name: Install Dependencies + - name: Setup Environment uses: php-actions/composer@v6 with: command: update php_version: "8.0" - - name: PHPStan Static Analysis + - name: Run PHPStan uses: php-actions/phpstan@v3 with: path: src/ diff --git a/README.md b/README.md index b4e671e..900ecc6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # Useful PHP Basics +[![PHPStan](https://github.com/opencultureconsulting/php-basics/actions/workflows/phpstan.yml/badge.svg)](https://github.com/opencultureconsulting/php-basics/actions/workflows/phpstan.yml) +[![PHPMD](https://github.com/opencultureconsulting/php-basics/actions/workflows/phpmd.yml/badge.svg)](https://github.com/opencultureconsulting/php-basics/actions/workflows/phpmd.yml) + This is a collection of generic [Classes](https://www.php.net/manual/en/language.oop5.php), [Functions](https://www.php.net/manual/en/language.functions.php) and useful [Traits](https://www.php.net/manual/en/language.oop5.traits.php) for your PHP projects.