Skip to content

Commit

Permalink
Merge pull request #747 from nextcloud/ci/static-analysis
Browse files Browse the repository at this point in the history
ci: Add psalm
  • Loading branch information
blizzz committed Jul 18, 2023
2 parents 0cbe975 + 536bcf9 commit d253fcb
Show file tree
Hide file tree
Showing 7 changed files with 587 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Static analysis

on:
pull_request:
push:
branches:
- master
- main
- stable*

concurrency:
group: psalm-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
static-analysis:
runs-on: ubuntu-latest

name: Nextcloud
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Set up php
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
with:
php-version: 8.1
coverage: none
ini-file: development
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer i

- name: Run coding standards check
run: composer run psalm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
build
/vendor/
.php_cs.cache
.php-cs-fixer.cache

!/tests/integration/

Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
"scripts": {
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"psalm": "psalm.phar",
"lint": "find . -name \\*.php -not -path '*/vendor/*' -print0 | xargs -0 -n1 php -l",
"test:unit": "phpunit -c tests/unit/phpunit.xml"
},
"require-dev": {
"nextcloud/coding-standard": "^1.0.0",
"phpunit/phpunit": "^9"
"nextcloud/coding-standard": "^1.1",
"phpunit/phpunit": "^9",
"psalm/phar": "^5.13",
"nextcloud/ocp": "^27.0"
}
}
282 changes: 281 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d253fcb

Please sign in to comment.