Skip to content

Commit 43cb228

Browse files
authored
feat(ci): Run all jobs but skip steps if paths do not match (#114)
- Removed the paths filter from the push and pull_request triggers in each workflow. - Added a new 'changes' job to each workflow that uses the dorny/paths-filter action to determine if the relevant sample files have been modified. - Added a conditional 'if' statement to the 'build' job that only runs the job if the 'changes' job determines that the sample files have been modified.
1 parent f55f02f commit 43cb228

4 files changed

Lines changed: 64 additions & 24 deletions

File tree

.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ name: Build AndroidDeveloperVerificationOnboarding
1616
on:
1717
push:
1818
branches: [ '*' ]
19-
paths:
20-
- 'AndroidDeveloperVerificationOnboarding/**'
21-
- '.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml'
2219
pull_request:
2320
branches: [ '*' ]
24-
paths:
25-
- 'AndroidDeveloperVerificationOnboarding/**'
26-
- '.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml'
2721
merge_group:
2822
types: [checks_requested]
2923
workflow_dispatch:
@@ -33,8 +27,24 @@ concurrency:
3327
cancel-in-progress: true
3428

3529
jobs:
30+
changes:
31+
runs-on: ubuntu-latest
32+
outputs:
33+
sample: ${{ steps.filter.outputs.sample }}
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
37+
id: filter
38+
with:
39+
filters: |
40+
sample:
41+
- 'AndroidDeveloperVerificationOnboarding/**'
42+
- '.github/workflows/Build_AndroidDeveloperVerificationOnboarding.yml'
43+
3644
build:
3745
name: Build AndroidDeveloperVerificationOnboarding
46+
needs: changes
47+
if: ${{ needs.changes.outputs.sample == 'true' }}
3848
runs-on: ubuntu-latest
3949
timeout-minutes: 30
4050

.github/workflows/Build_BiometricAuthentication.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ name: Build BiometricAuthentication
1616
on:
1717
push:
1818
branches: [ '*' ]
19-
paths:
20-
- 'BiometricAuthentication/**'
21-
- '.github/workflows/Build_BiometricAuthentication.yml'
2219
pull_request:
2320
branches: [ '*' ]
24-
paths:
25-
- 'BiometricAuthentication/**'
26-
- '.github/workflows/Build_BiometricAuthentication.yml'
2721
merge_group:
2822
types: [checks_requested]
2923
workflow_dispatch:
@@ -33,8 +27,24 @@ concurrency:
3327
cancel-in-progress: true
3428

3529
jobs:
30+
changes:
31+
runs-on: ubuntu-latest
32+
outputs:
33+
sample: ${{ steps.filter.outputs.sample }}
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
37+
id: filter
38+
with:
39+
filters: |
40+
sample:
41+
- 'BiometricAuthentication/**'
42+
- '.github/workflows/Build_BiometricAuthentication.yml'
43+
3644
build:
3745
name: Build BiometricAuthentication
46+
needs: changes
47+
if: ${{ needs.changes.outputs.sample == 'true' }}
3848
runs-on: ubuntu-latest
3949
timeout-minutes: 30
4050

.github/workflows/Build_BiometricLoginKotlin.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ name: Build BiometricLoginKotlin
1616
on:
1717
push:
1818
branches: [ '*' ]
19-
paths:
20-
- 'BiometricLoginKotlin/**'
21-
- '.github/workflows/Build_BiometricLoginKotlin.yml'
2219
pull_request:
2320
branches: [ '*' ]
24-
paths:
25-
- 'BiometricLoginKotlin/**'
26-
- '.github/workflows/Build_BiometricLoginKotlin.yml'
2721
merge_group:
2822
types: [checks_requested]
2923
workflow_dispatch:
@@ -33,8 +27,24 @@ concurrency:
3327
cancel-in-progress: true
3428

3529
jobs:
30+
changes:
31+
runs-on: ubuntu-latest
32+
outputs:
33+
sample: ${{ steps.filter.outputs.sample }}
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
37+
id: filter
38+
with:
39+
filters: |
40+
sample:
41+
- 'BiometricLoginKotlin/**'
42+
- '.github/workflows/Build_BiometricLoginKotlin.yml'
43+
3644
build:
3745
name: Build BiometricLoginKotlin
46+
needs: changes
47+
if: ${{ needs.changes.outputs.sample == 'true' }}
3848
runs-on: ubuntu-latest
3949
timeout-minutes: 30
4050

.github/workflows/Build_DirectBoot.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ name: Build DirectBoot
1616
on:
1717
push:
1818
branches: [ '*' ]
19-
paths:
20-
- 'DirectBoot/**'
21-
- '.github/workflows/Build_DirectBoot.yml'
2219
pull_request:
2320
branches: [ '*' ]
24-
paths:
25-
- 'DirectBoot/**'
26-
- '.github/workflows/Build_DirectBoot.yml'
2721
merge_group:
2822
types: [checks_requested]
2923
workflow_dispatch:
@@ -33,8 +27,24 @@ concurrency:
3327
cancel-in-progress: true
3428

3529
jobs:
30+
changes:
31+
runs-on: ubuntu-latest
32+
outputs:
33+
sample: ${{ steps.filter.outputs.sample }}
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
37+
id: filter
38+
with:
39+
filters: |
40+
sample:
41+
- 'DirectBoot/**'
42+
- '.github/workflows/Build_DirectBoot.yml'
43+
3644
build:
3745
name: Build DirectBoot
46+
needs: changes
47+
if: ${{ needs.changes.outputs.sample == 'true' }}
3848
runs-on: ubuntu-latest
3949
timeout-minutes: 30
4050

0 commit comments

Comments
 (0)