Skip to content

Commit

Permalink
Add file filter to android PR check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matejsemancik committed Nov 24, 2023
1 parent 7141017 commit 82d5f55
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/android_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,31 @@ concurrency:
cancel-in-progress: true

jobs:
pr:
detect-changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
# Matches all files which can affect iOS build, when changed
iosFiles: ${{ steps.file-changes.outputs.notAndroid }}
# Matches all files which can affect Android build, when changed
androidFiles: ${{ steps.file-changes.outputs.notIos }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect Changes
uses: dorny/paths-filter@v2
id: file-changes
with:
filters: |
notAndroid:
- "!(androidApp/**)"
notIos:
- "!(iosApp/**)"
pr-check:
name: Android PR check
runs-on: [ ubuntu-latest ]
needs: detect-changes
if: ${{ needs.detect-changes.outputs.androidFiles == 'true' }}
env:
# TODO Platform-specific slack channel name for notifications, eg. "gmlh-android"
SLACK_CHANNEL: project-slack-channel-name
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ios_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ jobs:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
shouldRunJobs: ${{ steps.file-changes.outputs.anythingExceptAndroid }}
# Matches all files which can affect iOS build, when changed
iosFiles: ${{ steps.file-changes.outputs.notAndroid }}
# Matches all files which can affect Android build, when changed
androidFiles: ${{ steps.file-changes.outputs.notIos }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -20,14 +23,16 @@ jobs:
id: file-changes
with:
filters: |
anythingExceptAndroid:
notAndroid:
- "!(androidApp/**)"
notIos:
- "!(iosApp/**)"
test:
name: iOS Test
runs-on: self-hosted
timeout-minutes: 30
needs: detect-changes
if: ${{ needs.detect-changes.outputs.shouldRunJobs == 'true' }}
if: ${{ needs.detect-changes.outputs.iosFiles == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit 82d5f55

Please sign in to comment.