Skip to content
Merged
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
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
day: saturday
time: "03:00"
timezone: Europe/Paris
open-pull-requests-limit: 10
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
day: saturday
time: "03:00"
timezone: Europe/Paris
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
day: saturday
time: "03:00"
timezone: Europe/Paris
open-pull-requests-limit: 10
25 changes: 23 additions & 2 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,30 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['8.1']
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
databases: ['sqlite']
server-versions: ['master']
server-versions: ['stable26', 'stable27', 'stable28', 'stable29', 'stable30', 'stable31', 'master']
exclude:
- php-versions: '8.4'
server-versions: 'stable30'
- php-versions: '8.4'
server-versions: 'stable29'
- php-versions: '8.4'
server-versions: 'stable28'
- php-versions: '8.4'
server-versions: 'stable27'
- php-versions: '8.4'
server-versions: 'stable26'
- php-versions: '8.3'
server-versions: 'stable27'
- php-versions: '8.3'
server-versions: 'stable26'
- php-versions: '8.0'
server-versions: 'master'
- php-versions: '8.0'
server-versions: 'stable31'
- php-versions: '8.0'
server-versions: 'stable30'

name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/psalm-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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
#
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Static analysis

on: pull_request

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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
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
strategy:
# do not stop on another job's failure
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.ocp-matrix) }}

name: static-psalm-analysis ${{ matrix.ocp-version }}
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

- name: Set up php${{ matrix.php-min }}
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
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 --no-scripts
composer i


- 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 -- --threads=1 --monochrome --no-progress --output-format=github

summary:
runs-on: ubuntu-latest-low
needs: static-analysis

if: always()

name: static-psalm-analysis-summary

steps:
- name: Summary status
run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi
44 changes: 0 additions & 44 deletions .github/workflows/psalm.yml

This file was deleted.

2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ or any place where the smart picker is integrated.]]></description>
<screenshot>https://github.com/julien-nc/text_templates/raw/main/img/screenshot3.jpg</screenshot>
<screenshot>https://github.com/julien-nc/text_templates/raw/main/img/screenshot4.jpg</screenshot>
<dependencies>
<nextcloud min-version="26" max-version="31"/>
<nextcloud min-version="26" max-version="32"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min version needs to be adjusted as well, if we drop php 8.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to drop 8.0 here? I just adapted the composer config but left it in the require list, the tests seem fine

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The psalm action only runs with Php 8.4 (the biggest supported one). I think Marcel means that Psalm 6.12 does not support Php 8.0 anymore so the min Nextcloud version of the app should be bumped to the first one that drops support for Php 8.0 (NC 30).

Could you use the psalm-matrix action from the company templates here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Psalm 6.12 cannot run with 8.0 but it can target 8.0 so I'd say it`s fine?

</dependencies>
<settings>
<admin>OCA\TextTemplates\Settings\Admin</admin>
Expand Down
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Nextcloud - TextTemplates
*
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
],
"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",
"cs:check": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --dry-run --diff",
"cs:fix": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix",
"psalm": "psalm --no-cache",
"test:unit": "phpunit --config tests/phpunit.xml",
"post-install-cmd": [
Expand All @@ -26,11 +26,12 @@
]
},
"require": {
"php": "^8.0 || ^8.1 || ^8.2 || ^8.3",
"php": "^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4",
"bamarni/composer-bin-plugin": "^1.8"
},
"require-dev": {
"nextcloud/ocp": "dev-master"
"nextcloud/ocp": "dev-master",
"doctrine/dbal": "^3.9.1"
},
"autoload": {
"psr-4": {
Expand All @@ -45,7 +46,7 @@
"config": {
"optimize-autoloader": true,
"platform": {
"php": "8.0"
"php": "8.1"
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true,
Expand Down
Loading