Skip to content

Commit 324720f

Browse files
authored
Merge pull request #571 from nextcloud/backport/566/stable26
[stable26] Add psalm workflow
2 parents 4a9d90a + 9c1a805 commit 324720f

File tree

13 files changed

+1501
-174
lines changed

13 files changed

+1501
-174
lines changed

.drone.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,16 @@ kind: pipeline
22
name: checkers
33
steps:
44
- name: compatibility
5-
image: nextcloudci/php8.0:latest
5+
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
66
environment:
77
APP_NAME: ldap_write_support
8-
CORE_BRANCH: master
8+
CORE_BRANCH: stable26
99
DB: sqlite
1010
commands:
1111
# Pre-setup steps
1212
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
1313
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
1414
- cd ../server
15-
- name: syntax-php8.0
16-
image: nextcloudci/php8.0:latest
17-
environment:
18-
APP_NAME: ldap_write_support
19-
CORE_BRANCH: stable26
20-
DB: sqlite
21-
commands:
22-
- composer install
23-
- ./vendor/bin/parallel-lint --exclude ./vendor/ .
2415
type: docker
2516
trigger:
2617
branch:

.github/workflows/psalm.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
name: Static analysis
7+
8+
on:
9+
pull_request:
10+
push:
11+
branches:
12+
- master
13+
- main
14+
- stable*
15+
16+
concurrency:
17+
group: psalm-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
static-analysis:
22+
runs-on: ubuntu-latest
23+
24+
name: Psalm
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
28+
29+
- name: Set up php
30+
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # v2
31+
with:
32+
php-version: 8.1
33+
coverage: none
34+
ini-file: development
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Install dependencies
39+
run: composer i
40+
41+
- name: Run coding standards check
42+
run: composer run psalm

.nextcloudignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ package-lock.json
2121
README.md
2222
webpack.js
2323
img/screenshots
24+
psalm.xml

composer.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
"name": "nextcloud/ldap_write_support",
33
"type": "project",
44
"require-dev": {
5-
"php-parallel-lint/php-parallel-lint": "^1.2",
6-
"nextcloud/coding-standard": "^1.0"
5+
"nextcloud/coding-standard": "^1.0",
6+
"nextcloud/ocp": "dev-master",
7+
"vimeo/psalm": "^5.9"
78
},
8-
"scripts": {
9-
"cs:fix": "php-cs-fixer fix",
9+
"scripts": {
10+
"cs:fix": "php-cs-fixer fix",
1011
"cs:check": "php-cs-fixer fix --dry-run --diff",
11-
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l"
12+
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l",
13+
"psalm": "psalm",
14+
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
15+
"psalm:update-baseline": "psalm --threads=1 --update-baseline"
16+
},
17+
"platform": {
18+
"php": "8.0"
1219
},
1320
"license": "AGPLv3",
1421
"authors": [

0 commit comments

Comments
 (0)