diff --git a/.github/workflows/nextcloud-build-npm.yml b/.github/workflows/nextcloud-build-npm.yml index a5fc830..4568e8f 100644 --- a/.github/workflows/nextcloud-build-npm.yml +++ b/.github/workflows/nextcloud-build-npm.yml @@ -40,6 +40,9 @@ jobs: src: ${{ steps.changes.outputs.src }} steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 id: changes continue-on-error: true diff --git a/.github/workflows/nextcloud-lint-appinfo-xml.yml b/.github/workflows/nextcloud-lint-appinfo-xml.yml index 50c9451..48be1c9 100644 --- a/.github/workflows/nextcloud-lint-appinfo-xml.yml +++ b/.github/workflows/nextcloud-lint-appinfo-xml.yml @@ -18,13 +18,42 @@ on: required: false type: string default: 'https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd' + path-filters: + description: 'Paths to filter on (YAML format)' + required: false + type: string + default: | + - 'appinfo/info.xml' permissions: contents: read jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: changes + continue-on-error: true + with: + filters: | + src: + ${{ inputs.path-filters }} + xml-linters: runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.src != 'false' name: info.xml lint steps: @@ -39,3 +68,17 @@ jobs: with: xml-file: ${{ inputs.xml-file }} xml-schema-file: ./info.xsd + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [changes, xml-linters] + + if: always() + + name: appinfo-xml-summary + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.xml-linters.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/nextcloud-lint-eslint.yml b/.github/workflows/nextcloud-lint-eslint.yml index 648cb27..75fe7af 100644 --- a/.github/workflows/nextcloud-lint-eslint.yml +++ b/.github/workflows/nextcloud-lint-eslint.yml @@ -40,6 +40,9 @@ jobs: src: ${{ steps.changes.outputs.src }} steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 id: changes continue-on-error: true diff --git a/.github/workflows/nextcloud-lint-openapi.yml b/.github/workflows/nextcloud-lint-openapi.yml index f0c6395..35190b2 100644 --- a/.github/workflows/nextcloud-lint-openapi.yml +++ b/.github/workflows/nextcloud-lint-openapi.yml @@ -18,15 +18,43 @@ on: required: false type: string default: 'src/types/openapi/openapi*.ts' + path-filters: + description: 'Paths to filter on (YAML format)' + required: false + type: string + default: | + - 'lib/**/*.php' + - 'openapi.json' permissions: contents: read jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: changes + continue-on-error: true + with: + filters: | + src: + ${{ inputs.path-filters }} + openapi: runs-on: ubuntu-latest - - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} + needs: changes + if: needs.changes.outputs.src != 'false' && github.repository_owner != 'nextcloud-gmbh' steps: - name: Checkout @@ -76,3 +104,17 @@ jobs: git status git --no-pager diff exit 1 + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [changes, openapi] + + if: always() + + name: openapi-summary + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.openapi.result != 'success' && needs.openapi.result != 'skipped' }}; then exit 1; fi diff --git a/.github/workflows/nextcloud-lint-php-cs.yml b/.github/workflows/nextcloud-lint-php-cs.yml index b81bfa4..4aa3848 100644 --- a/.github/workflows/nextcloud-lint-php-cs.yml +++ b/.github/workflows/nextcloud-lint-php-cs.yml @@ -18,13 +18,43 @@ on: required: false type: string default: 'bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite' + path-filters: + description: 'Paths to filter on (YAML format)' + required: false + type: string + default: | + - '**.php' + - '.php-cs-fixer.dist.php' permissions: contents: read jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: changes + continue-on-error: true + with: + filters: | + src: + ${{ inputs.path-filters }} + lint: runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.src != 'false' name: php-cs @@ -51,3 +81,17 @@ jobs: - name: Lint run: ${{ inputs.cs-check-command }} + + summary: + permissions: + contents: none + runs-on: ubuntu-latest + needs: [changes, lint] + + if: always() + + name: php-cs-summary + + steps: + - name: Summary status + run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/nextcloud-lint-php.yml b/.github/workflows/nextcloud-lint-php.yml index 9c800d2..604fcc5 100644 --- a/.github/workflows/nextcloud-lint-php.yml +++ b/.github/workflows/nextcloud-lint-php.yml @@ -18,13 +18,42 @@ on: required: false type: string default: 'bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite' + path-filters: + description: 'Paths to filter on (YAML format)' + required: false + type: string + default: | + - '**.php' permissions: contents: read jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: changes + continue-on-error: true + with: + filters: | + src: + ${{ inputs.path-filters }} + matrix: runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.src != 'false' outputs: php-versions: ${{ steps.versions.outputs.php-versions }} steps: @@ -36,7 +65,8 @@ jobs: php-lint: runs-on: ubuntu-latest - needs: matrix + needs: [changes, matrix] + if: needs.changes.outputs.src != 'false' strategy: matrix: php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}} @@ -64,7 +94,7 @@ jobs: permissions: contents: none runs-on: ubuntu-latest - needs: php-lint + needs: [changes, php-lint] if: always() @@ -72,4 +102,4 @@ jobs: steps: - name: Summary status - run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi + run: if ${{ needs.changes.outputs.src != 'false' && needs.php-lint.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/nextcloud-phpunit-incremental.yml b/.github/workflows/nextcloud-phpunit-incremental.yml index 3e9727d..6187ab1 100644 --- a/.github/workflows/nextcloud-phpunit-incremental.yml +++ b/.github/workflows/nextcloud-phpunit-incremental.yml @@ -60,6 +60,9 @@ jobs: src: ${{ steps.changes.outputs.src }} steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 id: changes continue-on-error: true diff --git a/.github/workflows/nextcloud-phpunit-mysql.yml b/.github/workflows/nextcloud-phpunit-mysql.yml index ad183c3..280f830 100644 --- a/.github/workflows/nextcloud-phpunit-mysql.yml +++ b/.github/workflows/nextcloud-phpunit-mysql.yml @@ -86,6 +86,9 @@ jobs: src: ${{ steps.changes.outputs.src}} steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 id: changes continue-on-error: true diff --git a/.github/workflows/nextcloud-phpunit-pgsql.yml b/.github/workflows/nextcloud-phpunit-pgsql.yml index c7ae71f..3f79579 100644 --- a/.github/workflows/nextcloud-phpunit-pgsql.yml +++ b/.github/workflows/nextcloud-phpunit-pgsql.yml @@ -74,6 +74,9 @@ jobs: src: ${{ steps.changes.outputs.src }} steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 id: changes continue-on-error: true diff --git a/.github/workflows/nextcloud-psalm.yml b/.github/workflows/nextcloud-psalm.yml index 1ae86f1..9ac4c94 100644 --- a/.github/workflows/nextcloud-psalm.yml +++ b/.github/workflows/nextcloud-psalm.yml @@ -18,13 +18,43 @@ on: required: false type: string default: 'bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite' + path-filters: + description: 'Paths to filter on (YAML format)' + required: false + type: string + default: | + - '**.php' + - 'psalm.xml' permissions: contents: read jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + + outputs: + src: ${{ steps.changes.outputs.src }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: dorny/paths-filter@v3 + id: changes + continue-on-error: true + with: + filters: | + src: + ${{ inputs.path-filters }} + matrix: runs-on: ubuntu-latest + needs: changes + if: needs.changes.outputs.src != 'false' outputs: ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }} steps: @@ -36,7 +66,8 @@ jobs: static-analysis: runs-on: ubuntu-latest - needs: matrix + needs: [changes, matrix] + if: needs.changes.outputs.src != 'false' strategy: fail-fast: false matrix: ${{ fromJson(needs.matrix.outputs.ocp-matrix) }} @@ -67,7 +98,7 @@ jobs: summary: runs-on: ubuntu-latest - needs: static-analysis + needs: [changes, static-analysis] if: always() @@ -75,4 +106,4 @@ jobs: steps: - name: Summary status - run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi + run: if ${{ needs.changes.outputs.src != 'false' && needs.static-analysis.result != 'success' }}; then exit 1; fi diff --git a/.github/workflows/nextcloud-vitest.yml b/.github/workflows/nextcloud-vitest.yml index 6f833a4..ad5c825 100644 --- a/.github/workflows/nextcloud-vitest.yml +++ b/.github/workflows/nextcloud-vitest.yml @@ -46,6 +46,9 @@ jobs: src: ${{ steps.changes.outputs.src }} steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 id: changes continue-on-error: true