Skip to content

Commit

Permalink
ci: run phpunit-nodb only for relevant changes
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Sep 30, 2023
1 parent f07453a commit 3d2665d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 8 deletions.
13 changes: 13 additions & 0 deletions .github/filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Filters for https://github.com/dorny/paths-filter

phpunit:
- '**/*.json'
- '!package-lock.json'
- '!package.json'
- '**/*.php'
- '**/*.sh'
- '**/*.xml'
- '**/*.yml'
- '**/tests/**'
- '3rdparty'
- 'apps/theming/css'
38 changes: 30 additions & 8 deletions .github/workflows/nodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit 3d2665d

Please sign in to comment.