Skip to content

Commit c1d6c88

Browse files
authored
Run dependencyGuard task during CI (#1064)
* Run dependencyGuard task during CI Run the `dependencyGuard` task during CI, which will fail if there are detected changes. Change-Id: If5f2b18a4c765bd38a3353df2adaaa91cf1739c3 * Add actions to update dependency guard baselines * Update baselines * Better glob for update baselines action
1 parent aea26aa commit c1d6c88

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.github/workflows/Build.yaml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,41 @@ jobs:
4545
- name: Check spotless
4646
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
4747

48+
- name: Check Dependency Guard
49+
id: dependencyguard_verify
50+
continue-on-error: true
51+
run: ./gradlew dependencyGuard
52+
53+
- name: Prevent updating Dependency Guard baselines if this is a fork
54+
id: checkfork_dependencyguard
55+
continue-on-error: false
56+
if: steps.dependencyguard_verify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
57+
run: |
58+
echo "::error::Dependency Guard failed, please run the following to update baselines:\n" \
59+
" ./gradlew dependencyGuardBaseline" && exit 1
60+
61+
# Runs if previous job failed
62+
- name: Generate new screenshots if verification failed and it's a PR
63+
id: dependencyguard_baseline
64+
if: steps.dependencyguard_verify.outcome == 'failure' && github.event_name == 'pull_request'
65+
run: |
66+
./gradlew dependencyGuardBaseline
67+
68+
- name: Push new Dependency Guard baselines if available
69+
uses: stefanzweifel/git-auto-commit-action@v5
70+
if: steps.dependencyguard_baseline.outcome == 'success'
71+
with:
72+
file_pattern: '**/dependencies/*.txt'
73+
disable_globbing: true
74+
commit_message: "🤖 Updates baselines for Dependency Guard"
75+
4876
- name: Run all local screenshot tests (Roborazzi)
4977
id: screenshotsverify
5078
continue-on-error: true
5179
run: ./gradlew verifyRoborazziDemoDebug
5280

5381
- name: Prevent pushing new screenshots if this is a fork
54-
id: checkfork
82+
id: checkfork_screenshots
5583
continue-on-error: false
5684
if: steps.screenshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
5785
run: |

app/dependencies/prodReleaseRuntimeClasspath.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ androidx.vectordrawable:vectordrawable:1.1.0
112112
androidx.versionedparcelable:versionedparcelable:1.1.1
113113
androidx.viewpager:viewpager:1.0.0
114114
androidx.window:window:1.0.0
115-
androidx.work:work-runtime-ktx:2.9.0-rc01
116-
androidx.work:work-runtime:2.9.0-rc01
115+
androidx.work:work-runtime-ktx:2.9.0
116+
androidx.work:work-runtime:2.9.0
117117
com.caverock:androidsvg-aar:1.4
118118
com.google.accompanist:accompanist-drawablepainter:0.32.0
119119
com.google.accompanist:accompanist-permissions:0.32.0

0 commit comments

Comments
 (0)