-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(gha): check for unused resources in prs
- Loading branch information
1 parent
913569e
commit d2bbfad
Showing
8 changed files
with
89 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Set up environment | ||
description: Common environment setup steps for this repository | ||
|
||
inputs: | ||
jdk: | ||
description: Set up JDK | ||
required: false | ||
default: 'false' | ||
gradle: | ||
description: Set up Gradle | ||
required: false | ||
default: 'false' | ||
android-sdk: | ||
description: Accept Android SDK licenses | ||
required: false | ||
default: 'false' | ||
secrets: | ||
description: Decrypt secrets | ||
required: false | ||
default: 'false' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up JDK | ||
if: ${{ inputs.jdk || inputs.gradle }} | ||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | ||
with: | ||
java-version-file: '.java-version' | ||
distribution: 'temurin' | ||
# Using 'temurin' speeds up the job, because this distribution is cached by the runner. | ||
# See: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Hosted-Tool-Cache | ||
- name: Set up Gradle | ||
if: ${{ inputs.gradle }} | ||
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0 | ||
- name: Accept Android SDK licenses | ||
if: ${{ inputs.android-sdk }} | ||
shell: bash | ||
run: yes | ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --licenses | ||
- name: Decrypt secrets | ||
if: ${{ inputs.secrets }} | ||
env: | ||
GPG_KEY: ${{ secrets.gpg_key }} | ||
shell: bash | ||
run: secrets/decrypt.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
name: PR checks | ||
|
||
on: pull_request | ||
on: | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
android-lint: | ||
name: Android Lint | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Set up environment | ||
uses: ./.github/actions/setup-environment | ||
with: | ||
gradle: true | ||
android-sdk: true | ||
secrets: true | ||
- name: Run Android Lint | ||
run: scripts/run-android-lint.sh | ||
|
||
licenses: | ||
name: Validate licenses | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
- name: Set up JDK | ||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 | ||
- name: Set up environment | ||
uses: ./.github/actions/setup-environment | ||
with: | ||
java-version-file: '.java-version' | ||
distribution: 'temurin' | ||
# Using 'temurin' speeds up the job, because this distribution is cached by the runner. | ||
# See: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Hosted-Tool-Cache | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0 | ||
- name: Decrypt secrets | ||
env: | ||
GPG_KEY: ${{ secrets.gpg_key }} | ||
run: secrets/decrypt.sh | ||
gradle: true | ||
secrets: true | ||
- name: Validate licenses | ||
run: scripts/run-license-checks.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<resources | ||
xmlns:tools="http://schemas.android.com/tools" | ||
tools:ignore="UnusedResources" | ||
> | ||
<bool name="leak_canary_add_launcher_icon">false</bool> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<lint> | ||
<!-- Turn off all checks by default, so we can opt into just the ones we want. --> | ||
<issue id="all" severity="ignore" /> | ||
|
||
<issue id="UnusedResources" severity="error" /> | ||
</lint> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Fail if any commands fails. | ||
set -e | ||
|
||
./gradlew :Pocket:lint |