Lint #174
Workflow file for this run
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
name: Lint | |
on: | |
pull_request: | |
merge_group: | |
types: [checks_requested] | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
changes: | |
name: Check for Android changes | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
android: ${{ steps.filter.outputs.android }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
android: | |
- 'android/**' | |
- '.github/**' | |
lint: | |
name: ktlint & gradle lint | |
needs: changes | |
if: ${{ needs.changes.outputs.android == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Run ktlint | |
run: | | |
cd android | |
./gradlew lintKotlin --continue | |
./gradlew :build-logic:convention:lint --continue | |
detekt: | |
name: Detekt | |
needs: changes | |
if: ${{ needs.changes.outputs.android == 'true' }} | |
permissions: write-all | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Run detekt | |
run: | | |
cd android | |
./gradlew detektDebug --continue | |
- name: Upload SARIF report for code scanning report | |
uses: github/codeql-action/upload-sarif@v3 | |
if: success() || failure() | |
with: | |
sarif_file: android/build/reports/detekt/merge.sarif | |
# Used to differentiate multiple results for one commit | |
category: detekt |