]> git.mxchange.org Git - friendica.git/commitdiff
Add phpmd as code quality check in github actions
authorArt4 <art4@wlabs.de>
Wed, 25 Dec 2024 15:28:05 +0000 (15:28 +0000)
committerArt4 <art4@wlabs.de>
Wed, 25 Dec 2024 15:28:05 +0000 (15:28 +0000)
.github/workflows/code-quality.yml

index dad0aec9e124a84d34e59e9208833a76f31e0316..385501c1a961ec8700bfd21386a908371b145857 100644 (file)
@@ -75,3 +75,35 @@ jobs:
 
       - name: Run PHPStan
         run: composer run phpstan
+
+  phpmd:
+    name: PHPMD (PHP ${{ matrix.php }})
+    runs-on: ubuntu-latest
+
+    strategy:
+      fail-fast: false
+      matrix:
+        operating-system: ['ubuntu-latest']
+        php: ['8.4']
+
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v3
+        with:
+          fetch-depth: 2
+
+      - name: Setup PHP with composer and extensions
+        uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
+        with:
+          php-version: ${{ matrix.php }}
+          coverage: none
+          tools: none
+
+      - name: Clone addon repository
+        run: git clone -b develop --single-branch https://git.friendi.ca/friendica/friendica-addons.git addon
+
+      - name: Install Composer dependencies
+        uses: "ramsey/composer-install@v2"
+
+      - name: Run PHPMD
+        run: vendor/bin/phpmd src/ github .phpmd-ruleset.xml