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
48 changes: 48 additions & 0 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: MIT

name: Lint php-cs

on:
workflow_call:

permissions:
contents: read

concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
name: php-cs
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Get php version
id: versions
uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3

- name: Set up php${{ steps.versions.outputs.php-min }}
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ steps.versions.outputs.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
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Remove nextcloud/ocp
run: composer remove nextcloud/ocp --dev --no-scripts

- name: Install composer dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0

- name: Lint
run: composer run cs:check
77 changes: 77 additions & 0 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: MIT

name: Lint php

on:
workflow_call:

permissions:
contents: read

concurrency:
group: lint-php-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-min: ${{ steps.versions.outputs.php-min }}
php-max: ${{ steps.versions.outputs.php-max }}
steps:
- name: Checkout app
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Get version matrix
id: versions
uses: nextcloud-libraries/nextcloud-version-matrix@cd0211ffcef1065e2020cd579e4843b8746e7a58 # v1.3.3

php-lint:
runs-on: ubuntu-latest
needs: matrix
strategy:
matrix:
php-versions:
- '${{ needs.matrix.outputs.php-min }}'
- '${{ needs.matrix.outputs.php-max }}'

name: php-lint

steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: ${{ matrix.php-versions }}
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
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Lint
run: composer run lint

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: php-lint
if: always()
name: php-lint-summary
steps:
- name: Summary status
env:
RESULT: ${{ needs.php-lint.result }}
run: |
if [ "$RESULT" != "success" ] && [ "$RESULT" != "skipped" ]; then
exit 1
fi
11 changes: 11 additions & 0 deletions workflow-templates/lint-php-cs.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Lint PHP coding standards",
"description": "Run the project's PHP coding standards check using the minimum supported PHP version.",
"iconName": "octicon check-circle",
"categories": [
"PHP"
],
"filePatterns": [
"^composer.json$"
]
}
2 changes: 2 additions & 0 deletions workflow-templates/lint-php-cs.properties.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
SPDX-License-Identifier: AGPL-3.0-or-later
16 changes: 16 additions & 0 deletions workflow-templates/lint-php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

# This workflow is published through the LibreCode organization catalog.
# Implementation: LibreCodeCoop/github-workflows

name: Lint php-cs

on: pull_request

permissions:
contents: read

jobs:
lint-php-cs:
uses: LibreCodeCoop/github-workflows/.github/workflows/lint-php-cs.yml@bc97b54e3d33d58d6075a0994883acde00f0556c
12 changes: 12 additions & 0 deletions workflow-templates/lint-php.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Lint PHP",
"description": "Lint PHP code against the minimum and maximum PHP versions supported by the app.",
"iconName": "octicon code-square",
"categories": [
"PHP"
],
"filePatterns": [
"^composer.json$",
"^appinfo/info.xml$"
]
}
2 changes: 2 additions & 0 deletions workflow-templates/lint-php.properties.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
SPDX-License-Identifier: AGPL-3.0-or-later
16 changes: 16 additions & 0 deletions workflow-templates/lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

# This workflow is published through the LibreCode organization catalog.
# Implementation: LibreCodeCoop/github-workflows

name: Lint php

on: pull_request

permissions:
contents: read

jobs:
lint-php:
uses: LibreCodeCoop/github-workflows/.github/workflows/lint-php.yml@bc97b54e3d33d58d6075a0994883acde00f0556c
Loading