-
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.
Update Gradle configuration and GitHub Action workflow (#40)
## Changes made - Update the `code_quality.yml` workflow to use the latest actions versions. - Make Android Lint and Detekt generate SARIF files to be used by the `code_quality.yml` workflow. - Let the `code_quality.yml` workflow run for any PR, even in draft. - Remove unused dependencies from each modules. - Remove unused KAPT Gradle plugin. - Disable unused features in Android Gradle Plugin (`BuildConfig`, res value and shaders generation). ## Notes - No project dependencies have been updated in this PR. - I didn't update the data provider version, as this doesn't need a dedicated release. - If these changes should be merged, the branch protection rule needs to be updated to use the new validation names (`Android Lint`, `Detekt`, and `Unit Test`). --------- Co-authored-by: Joaquim Stähli <[email protected]>
- Loading branch information
Showing
9 changed files
with
90 additions
and
103 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 |
---|---|---|
@@ -1,75 +1,58 @@ | ||
name: Code quality | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
types: [synchronize, opened, reopened, ready_for_review] | ||
|
||
jobs: | ||
android-lint: | ||
if: github.event.pull_request.draft == false | ||
name: Android Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- uses: reviewdog/action-setup@v1 | ||
- name: Run android linter | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: lint | ||
- name: review linter | ||
uses: dvdandroid/action-android-lint@master | ||
with: | ||
github_token: ${{ secrets.RTS_DEVOPS_GITHUB_TOKEN }} | ||
lint_xml_file: ./build/reports/android-lint.xml | ||
reporter: github-pr-review | ||
- name: check linter | ||
uses: dvdandroid/action-android-lint@master | ||
with: | ||
github_token: ${{ secrets.RTS_DEVOPS_GITHUB_TOKEN }} | ||
lint_xml_file: ./build/reports/android-lint.xml | ||
reporter: github-pr-check | ||
- uses: gradle/actions/setup-gradle@v3 | ||
- name: Run Android Lint | ||
run: ./gradlew lint | ||
- uses: github/codeql-action/upload-sarif@v3 | ||
if: success() || failure() | ||
with: | ||
sarif_file: build/reports/android-lint/ | ||
category: android-lint | ||
|
||
detekt: | ||
if: github.event.pull_request.draft == false | ||
name: Detekt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- uses: reviewdog/action-setup@v1 | ||
- name: review detekt | ||
uses: alaegin/[email protected] | ||
with: | ||
github_token: ${{ secrets.RTS_DEVOPS_GITHUB_TOKEN }} | ||
detekt_config: config/detekt.yml | ||
reviewdog_reporter: github-pr-review | ||
detekt_excludes: "**/build/**,**/.idea/**,**/buildSrc/**,**/androidTest/**,**/test/**,**/resources/**" | ||
- name: check detekt | ||
uses: alaegin/[email protected] | ||
with: | ||
github_token: ${{ secrets.RTS_DEVOPS_GITHUB_TOKEN }} | ||
detekt_config: config/detekt.yml | ||
reviewdog_reporter: github-pr-check | ||
detekt_excludes: "**/build/**,**/.idea/**,**/buildSrc/**,**/androidTest/**,**/test/**,**/resources/**" | ||
- uses: gradle/actions/setup-gradle@v3 | ||
- name: Run Detekt | ||
run: ./gradlew detekt | ||
- uses: github/codeql-action/upload-sarif@v3 | ||
if: success() || failure() | ||
with: | ||
sarif_file: build/reports/detekt.sarif | ||
category: detekt | ||
|
||
android-unit-test: | ||
if: github.event.pull_request.draft == false | ||
unit-test: | ||
name: Unit Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: Run android local unit test | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: testDebug | ||
- uses: gradle/actions/setup-gradle@v3 | ||
- name: Run Unit Tests | ||
run: ./gradlew testDebug |
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
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
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
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
Oops, something went wrong.