Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add psalm checks #765

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ jobs:
databases: ['sqlite', 'mysql', 'pgsql']
server-versions: ['master']
include:
- php-versions: 8.1
databases: mysql
server-versions: stable24
- php-versions: 8.1
databases: mysql
server-versions: stable25
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
php-versions: ['7.4', '8.0', '8.1']
databases: ['mysql']
server-versions: ['stable24', 'stable25', 'stable26', 'stable27', 'stable28', 'master']
server-versions: ['stable25', 'stable26', 'stable27', 'stable28', 'master']
exclude:
- php-versions: 7.4
server-versions: master
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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: Psalm static analysis

on:
pull_request:
paths:
- .github/workflows/psalm.yml
- appinfo/**
- composer.*
- lib/**
- templates/**
- tests/**
push:
branches:
- main
- stable*
- test
paths:
- .github/workflows/psalm.yml
- appinfo/**
- composer.*
- lib/**
- templates/**
- tests/**

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

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

name: Psalm check
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up php
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
with:
php-version: 8.2
coverage: none
ini-file: development
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, gd, zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: composer i

- name: Run coding standards check
run: composer run psalm
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<bugs>https://github.com/nextcloud/user_oidc/issues</bugs>
<repository>https://github.com/nextcloud/user_oidc</repository>
<dependencies>
<nextcloud min-version="24" max-version="29"/>
<nextcloud min-version="25" max-version="29"/>
</dependencies>
<settings>
<admin>OCA\UserOIDC\Settings\AdminSettings</admin>
Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
"bamarni/composer-bin-plugin": true
},
"platform": {
"php": "7.4"
"php": "8.0"
}
},
"scripts": {
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"lint": "find . -name \\*.php ! -path './vendor/*' ! -path './vendor-bin/*' ! -path './lib/Vendor/*' -exec php -l \"{}\" \\;",
"test:unit": "phpunit -c tests/phpunit.xml",
"psalm": "psalm.phar --no-cache",
"post-install-cmd": [
"@composer bin all install --ansi",
"\"vendor/bin/mozart\" compose",
Expand All @@ -36,7 +37,9 @@
"require-dev": {
"nextcloud/coding-standard": "^1.0.0",
"symfony/event-dispatcher": "^4",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^9.5",
"nextcloud/ocp": "dev-stable25",
"psalm/phar": "^5.20"
},
"extra": {
"mozart": {
Expand Down
Loading
Loading