Skip to content
Open
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
27 changes: 21 additions & 6 deletions .github/workflows/psalm-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,27 @@ concurrency:
group: psalm-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
matrix:
runs-on: ubuntu-latest-low
outputs:
ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }}
steps:
- name: Checkout app
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1

- name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml
run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml

static-analysis:
runs-on: ubuntu-latest
needs: matrix
Expand All @@ -37,29 +46,35 @@ jobs:
name: static-psalm-analysis ${{ matrix.ocp-version }}
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false

- name: Set up php${{ matrix.php-min }}
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
with:
php-version: ${{ matrix.php-min }}
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
coverage: none
ini-file: development
# Temporary workaround for missing pcntl_* in PHP 8.3
ini-values: disable_functions=
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: |
composer remove nextcloud/ocp --dev
composer remove nextcloud/ocp --dev --no-scripts
composer i

- name: Check for vulnerable PHP dependencies
run: composer require --dev roave/security-advisories:dev-latest

- name: Install dependencies
- name: Install dependencies # zizmor: ignore[template-injection]
run: composer require --dev 'nextcloud/ocp:${{ matrix.ocp-version }}' --ignore-platform-reqs --with-dependencies

- name: Run coding standards check
run: composer run psalm
run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github

summary:
runs-on: ubuntu-latest-low
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
/vendor-bin/**/vendor/
vendor/
*.log
build/
Expand Down
45 changes: 24 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
{
"require-dev": {
"guzzlehttp/guzzle": "^7",
"nextcloud/coding-standard": "^1.0",
"nextcloud/ocp": "dev-stable28",
"phan/phan": "^5",
"php-cs-fixer/shim": "3.85.1",
"psalm/phar": "^5.26",
"squizlabs/php_codesniffer": "^3",
"staabm/annotate-pull-request-from-checkstyle": "^1.1.0"
"bamarni/composer-bin-plugin": "^1.8"
},
"autoload-dev": {
"psr-4": {
"OCA\\Notes\\Tests\\API\\": "tests/api/"
"OCA\\Notes\\Tests\\API\\": "tests/api/",
"OCP\\": "vendor/nextcloud/ocp/OCP"
}
},
"config": {
"platform": {
"php": "8.0"
},
"sort-packages": true
},
"prefer-stable": true,
"scripts": {
"test": [
"@test:unit"
"post-install-cmd": [
"@composer bin all install --ansi"
],
"post-update-cmd": [
"@composer bin all update --ansi"
],
"test:unit": "./vendor/bin/phpunit -c tests/unit/phpunit.xml",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"psalm": "psalm.phar",
"phan": "phan"
"psalm": "psalm --threads=1",
"psalm:update-baseline": "psalm --threads=1 --update-baseline",
"psalm:clear": "psalm --clear-cache && psalm --clear-global-cache",
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
"test:unit": "phpunit --bootstrap vendor/autoload.php --testdox tests/api/",
"openapi": "generate-spec"
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true,
"bamarni/composer-bin-plugin": true
},
"platform": {
"php": "8.0"
}
}
}
Loading
Loading