Skip to content

Commit 8d030f2

Browse files
add psalm
1 parent 5ad3d16 commit 8d030f2

File tree

4 files changed

+385
-4
lines changed

4 files changed

+385
-4
lines changed

.github/workflows/psalm-matrix.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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: pull_request
9+
10+
concurrency:
11+
group: psalm-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
static-analysis:
16+
runs-on: self-hosted
17+
strategy:
18+
# do not stop on another job's failure
19+
fail-fast: false
20+
matrix:
21+
ocp-version: [ 'dev-master', 'dev-stable28' ]
22+
23+
name: static-psalm-analysis ${{ matrix.ocp-version }}
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
27+
28+
- name: Set up php8.2
29+
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
30+
with:
31+
php-version: 8.2
32+
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
33+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib
34+
coverage: none
35+
ini-file: development
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Install dependencies
40+
run: composer i
41+
42+
- name: Install dependencies
43+
run: composer require --dev nextcloud/ocp:${{ matrix.ocp-version }} --ignore-platform-reqs --with-dependencies
44+
45+
- name: Run coding standards check
46+
run: composer run psalm
47+
48+
summary:
49+
runs-on: ubuntu-latest
50+
needs: static-analysis
51+
52+
if: always()
53+
54+
name: static-psalm-analysis-summary
55+
56+
steps:
57+
- name: Summary status
58+
run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,12 @@
1010
],
1111
"require": {},
1212
"require-dev": {
13-
}
13+
"nextcloud/ocp": "dev-stable28",
14+
"psalm/phar": "^5.17"
15+
},
16+
"scripts": {
17+
"psalm": "psalm.phar --threads=1",
18+
"psalm:dev": "psalm.phar --no-cache --threads=$(nproc)",
19+
"psalm:update-baseline": "psalm.phar --threads=1 --update-baseline"
20+
}
1421
}

composer.lock

Lines changed: 286 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)