diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml new file mode 100644 index 00000000000..ff271c1e716 --- /dev/null +++ b/.github/workflows/psalm.yml @@ -0,0 +1,30 @@ +name: Static analysis + +on: + pull_request: + push: + branches: + - master + - main + - stable* + +jobs: + static-analysis: + runs-on: ubuntu-latest + + name: Nextcloud ${{ matrix.ocp-version }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up php + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + coverage: none + + - name: Install dependencies + run: composer i + + - name: Run coding standards check + run: composer run psalm diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index 119dfe6a383..00000000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Static analysis - -on: [pull_request] - -jobs: - static-psalm-analysis: - runs-on: ubuntu-latest - strategy: - matrix: - ocp-version: [ 'dev-master' ] - php-version: [ '7.4', '8.0', '8.1' ] - name: Nextcloud ${{ matrix.ocp-version }} - steps: - - name: Checkout - uses: actions/checkout@master - - name: Set up php - uses: shivammathur/setup-php@master - with: - php-version: ${{ matrix.php-version }} - tools: composer:v1 - coverage: none - - name: Install dependencies - run: composer i - - name: Install dependencies - run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }} - - name: Run coding standards check - run: composer run psalm diff --git a/.github/workflows/update-nextcloud-ocp.yml b/.github/workflows/update-nextcloud-ocp.yml new file mode 100644 index 00000000000..a396b6f875b --- /dev/null +++ b/.github/workflows/update-nextcloud-ocp.yml @@ -0,0 +1,65 @@ +# 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: Update nextcloud/ocp + +on: + workflow_dispatch: + schedule: + - cron: "5 4 * * 0" + +jobs: + update-nextcloud-ocp: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + branches: ["master", "stable25", "stable24", "stable23"] + + name: update-nextcloud-ocp-${{ matrix.branches }} + + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ matrix.branches }} + submodules: true + + - name: Set up php7.4 + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip + coverage: none + + - name: Composer install + run: composer install + + - name: Composer update nextcloud/ocp + run: composer require --dev nextcloud/ocp:dev-${{ matrix.branches }} + continue-on-error: true + + - name: Reset checkout dirs + run: | + git clean -f 3rdparty + git clean -f vendor + git checkout 3rdparty vendor + continue-on-error: true + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + commit-message: Update psalm baseline + committer: GitHub + author: nextcloud-command + signoff: true + branch: automated/noid/${{ matrix.branches }}-update-nextcloud-ocp + title: "[${{ matrix.branches }}] Update nextcloud/ocp dependency" + body: | + Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency + labels: | + dependencies + 3. to review diff --git a/composer.json b/composer.json index c282adb445f..b02c4e99e63 100644 --- a/composer.json +++ b/composer.json @@ -1,29 +1,34 @@ { - "name": "nextcloud/text", - "type": "project", - "require-dev": { - "roave/security-advisories": "dev-master", - "christophwurst/nextcloud": "dev-master", - "nextcloud/coding-standard": "^1.0.0", - "psalm/phar": "^4.3", - "phpunit/phpunit": "^9.5", - "ext-mbstring": "*" - }, - "license": "AGPLv3", - "authors": [ - { - "name": "Julius Härtl", - "email": "jus@bitgrid.net" - } - ], - "require": { - "php": "^7.4|^8.0" - }, - "scripts": { - "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", - "test:unit": "phpunit -c tests/phpunit.xml" - } + "name": "nextcloud/text", + "type": "project", + "require-dev": { + "roave/security-advisories": "dev-master", + "nextcloud/coding-standard": "^1.0.0", + "psalm/phar": "^4.3", + "phpunit/phpunit": "^9.5", + "ext-mbstring": "*", + "nextcloud/ocp": "dev-master" + }, + "license": "AGPLv3", + "authors": [ + { + "name": "Julius Härtl", + "email": "jus@bitgrid.net" + } + ], + "require": { + "php": "^7.4|^8.0" + }, + "scripts": { + "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", + "test:unit": "phpunit -c tests/phpunit.xml" + }, + "autoload-dev": { + "psr-4": { + "OCP\\": "vendor/nextcloud/ocp/OCP" + } + } } diff --git a/composer.lock b/composer.lock index 4b2237ba393..d1941ef9924 100644 --- a/composer.lock +++ b/composer.lock @@ -4,53 +4,9 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5fbae4730c1f4bec14f467f9f9d375f6", + "content-hash": "cb6616ba6b44bb1c885dcb24eb65164a", "packages": [], "packages-dev": [ - { - "name": "christophwurst/nextcloud", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/ChristophWurst/nextcloud_composer.git", - "reference": "42b53effee9e232a9cf091760ee448d98eb2fae0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ChristophWurst/nextcloud_composer/zipball/42b53effee9e232a9cf091760ee448d98eb2fae0", - "reference": "42b53effee9e232a9cf091760ee448d98eb2fae0", - "shasum": "" - }, - "require": { - "php": "^7.4 || ~8.0 || ~8.1", - "psr/container": "^1.1.1", - "psr/event-dispatcher": "^1.0", - "psr/log": "^1.1" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "25.0.0-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "AGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Christoph Wurst", - "email": "christoph@winzerhof-wurst.at" - } - ], - "description": "Composer package containing Nextcloud's public API (classes, interfaces)", - "support": { - "issues": "https://github.com/ChristophWurst/nextcloud_composer/issues", - "source": "https://github.com/ChristophWurst/nextcloud_composer/tree/master" - }, - "time": "2022-08-25T02:31:45+00:00" - }, { "name": "composer/pcre", "version": "1.0.0", @@ -646,6 +602,49 @@ "description": "Nextcloud coding standards for the php cs fixer", "time": "2021-11-10T08:44:10+00:00" }, + { + "name": "nextcloud/ocp", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/nextcloud-deps/ocp.git", + "reference": "35711a5c821cc9589d58efa0ded87ae948ab71ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/35711a5c821cc9589d58efa0ded87ae948ab71ed", + "reference": "35711a5c821cc9589d58efa0ded87ae948ab71ed", + "shasum": "" + }, + "require": { + "php": "^7.4 || ~8.0 || ~8.1", + "psr/container": "^1.1.1", + "psr/event-dispatcher": "^1.0", + "psr/log": "^1.1" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "26.0.0-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at" + } + ], + "description": "Composer package containing Nextcloud's public API (classes, interfaces)", + "support": { + "source": "https://github.com/nextcloud-deps/ocp/tree/master" + }, + "time": "2022-09-22T12:49:25+00:00" + }, { "name": "nikic/php-parser", "version": "v4.15.1", @@ -4296,7 +4295,7 @@ "minimum-stability": "stable", "stability-flags": { "roave/security-advisories": 20, - "christophwurst/nextcloud": 20 + "nextcloud/ocp": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/psalm.xml b/psalm.xml index 8a9fc054121..2d57aa16d20 100644 --- a/psalm.xml +++ b/psalm.xml @@ -13,7 +13,7 @@ - + diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 4280c4a47ae..917bf996c2a 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -105,7 +105,7 @@ \OC\User\NoUserException - + $jobList