diff --git a/.github/filters.yml b/.github/filters.yml new file mode 100644 index 0000000000000..96b4ba9371251 --- /dev/null +++ b/.github/filters.yml @@ -0,0 +1,11 @@ +# Filters for https://github.com/dorny/paths-filter + +phpunit: + - '**/*.json' + - '**/*.php' + - '**/*.sh' + - '**/*.xml' + - '**/*.yml' + - '**/tests/**' + - '3rdparty' + - 'apps/theming/css' diff --git a/.github/workflows/nodb.yml b/.github/workflows/nodb.yml index 4191bc985428e..ad18938831203 100644 --- a/.github/workflows/nodb.yml +++ b/.github/workflows/nodb.yml @@ -16,10 +16,32 @@ concurrency: cancel-in-progress: true jobs: - phpunit-nodb: + changes: runs-on: ubuntu-latest + name: nodb-changes - if: ${{ github.repository_owner != 'nextcloud-gmbh' }} + # Required permissions + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + phpunit: ${{ steps.filter.outputs.phpunit }} + steps: + - name: Checkout server + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + submodules: true + - uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1 + id: filter + with: + filters: .github/filters.yml + + phpunit: + runs-on: ubuntu-latest + name: nodb-phpunit + + needs: changes + if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.phpunit == 'true' }} strategy: matrix: @@ -65,16 +87,16 @@ jobs: # run: phpunit --configuration phpunit-autotest.xml --exclude-group DB,SLOWDB,PRIMARY-azure,PRIMARY-s3,PRIMARY-swift run: phpunit --configuration phpunit-autotest.xml --exclude-group DB,SLOWDB - summary-nodb: - permissions: - contents: none + summary: runs-on: ubuntu-latest - needs: phpunit-nodb + name: nodb-summary + needs: [changes, phpunit] if: always() - name: phpunit-nodb-summary + permissions: + contents: none steps: - name: Summary status - run: if ${{ needs.phpunit-nodb.result != 'success' }}; then exit 1; fi + run: if ${{ needs.changes.outputs.phpunit == 'true' && needs.phpunit.result != 'success' }}; then exit 1; fi