Skip to content

Commit

Permalink
Merge pull request #571 from nextcloud/backport/566/stable26
Browse files Browse the repository at this point in the history
[stable26] Add psalm workflow
  • Loading branch information
come-nc authored Apr 20, 2023
2 parents 4a9d90a + 9c1a805 commit 324720f
Show file tree
Hide file tree
Showing 13 changed files with 1,501 additions and 174 deletions.
13 changes: 2 additions & 11 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,16 @@ kind: pipeline
name: checkers
steps:
- name: compatibility
image: nextcloudci/php8.0:latest
image: ghcr.io/nextcloud/continuous-integration-php8.0:latest
environment:
APP_NAME: ldap_write_support
CORE_BRANCH: master
CORE_BRANCH: stable26
DB: sqlite
commands:
# Pre-setup steps
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../server
- name: syntax-php8.0
image: nextcloudci/php8.0:latest
environment:
APP_NAME: ldap_write_support
CORE_BRANCH: stable26
DB: sqlite
commands:
- composer install
- ./vendor/bin/parallel-lint --exclude ./vendor/ .
type: docker
trigger:
branch:
Expand Down
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: Psalm
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3

- name: Set up php
uses: shivammathur/setup-php@1a18b2267f80291a81ca1d33e7c851fe09e7dfc4 # 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 .nextcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ package-lock.json
README.md
webpack.js
img/screenshots
psalm.xml
17 changes: 12 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
"name": "nextcloud/ldap_write_support",
"type": "project",
"require-dev": {
"php-parallel-lint/php-parallel-lint": "^1.2",
"nextcloud/coding-standard": "^1.0"
"nextcloud/coding-standard": "^1.0",
"nextcloud/ocp": "dev-master",
"vimeo/psalm": "^5.9"
},
"scripts": {
"cs:fix": "php-cs-fixer fix",
"scripts": {
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l"
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -not -path './node_modules/*' -print0 | xargs -0 -n1 php -l",
"psalm": "psalm",
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"psalm:update-baseline": "psalm --threads=1 --update-baseline"
},
"platform": {
"php": "8.0"
},
"license": "AGPLv3",
"authors": [
Expand Down
Loading

0 comments on commit 324720f

Please sign in to comment.