Skip to content
Closed
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
17 changes: 17 additions & 0 deletions .github/changes-filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
backend:
- '.github/workflows/**'
- 'appinfo/**'
- 'lib/**'
- 'templates/**'
- 'tests/php/**'
- 'vendor/**'
- 'vendor-bin/**'
- 'composer/**'
- 'composer.json'
- 'composer.lock'
- 'phpunit.integration.xml'
- 'phpunit.unit'
- '.php-cs-fixer.dist.php'
- 'psalm.xml'
35 changes: 35 additions & 0 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,29 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest-low
permissions:
contents: read
pull-requests: read
outputs:
backend: ${{ steps.changes.outputs.backend }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 1
sparse-checkout: .github/changes-filters.yml
sparse-checkout-cone-mode: false
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: changes
continue-on-error: true
with:
filters: .github/changes-filters.yml

lint:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.backend != 'false'

name: php-cs

Expand Down Expand Up @@ -50,3 +71,17 @@ jobs:

- name: Lint
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

summary:
permissions:
contents: none
runs-on: ubuntu-latest-low
needs: lint

if: always()

name: php-cs-lint-summary

steps:
- name: Summary status
run: if ${{ needs.lint.result != 'success' && needs.lint.result != 'skipped' }}; then exit 1; fi
21 changes: 21 additions & 0 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,29 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest-low
permissions:
contents: read
pull-requests: read
outputs:
backend: ${{ steps.changes.outputs.backend }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 1
sparse-checkout: .github/changes-filters.yml
sparse-checkout-cone-mode: false
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: changes
continue-on-error: true
with:
filters: .github/changes-filters.yml

matrix:
runs-on: ubuntu-latest-low
needs: changes
if: needs.changes.outputs.backend != 'false'
outputs:
php-min: ${{ steps.versions.outputs.php-min }}
php-max: ${{ steps.versions.outputs.php-max }}
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/php-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,29 @@ name: PHP Tests
on: pull_request

jobs:
changes:
runs-on: ubuntu-latest-low
permissions:
contents: read
pull-requests: read
outputs:
backend: ${{ steps.changes.outputs.backend }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 1
sparse-checkout: .github/changes-filters.yml
sparse-checkout-cone-mode: false
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: changes
continue-on-error: true
with:
filters: .github/changes-filters.yml

unit-tests:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.backend != 'false'
strategy:
matrix:
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
Expand Down Expand Up @@ -55,6 +76,8 @@ jobs:

integration-tests:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.backend != 'false'
strategy:
matrix:
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
Expand Down Expand Up @@ -96,7 +119,7 @@ jobs:
run: composer run test:integration

summary:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-low
needs:
- unit-tests
- integration-tests
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/psalm-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,29 @@ permissions:
contents: read

jobs:
changes:
runs-on: ubuntu-latest-low
permissions:
contents: read
pull-requests: read
outputs:
backend: ${{ steps.changes.outputs.backend }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 1
sparse-checkout: .github/changes-filters.yml
sparse-checkout-cone-mode: false
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: changes
continue-on-error: true
with:
filters: .github/changes-filters.yml

matrix:
runs-on: ubuntu-latest-low
needs: changes
if: needs.changes.outputs.backend != 'false'
outputs:
ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }}
steps:
Expand Down Expand Up @@ -86,4 +107,4 @@ jobs:

steps:
- name: Summary status
run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi
run: if ${{ needs.static-analysis.result != 'success' && needs.static-analysis.result != 'skipped' }}; then exit 1; fi
Loading