This repository was archived by the owner on Aug 3, 2025. It is now read-only.
Lint #1677
This file contains hidden or 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 | |
| # Run workflow each time code is pushed to your repository and on a schedule. | |
| # The scheduled workflow runs every Thursday at 15:45 UTC. | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: "45 15 * * 4" | |
| jobs: | |
| lint-detekt: | |
| name: Lint using detekt π¬ | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Gradle π¦ | |
| uses: gradle/gradle-build-action@v3 | |
| - name: Grant execute permission for gradlew π | |
| run: chmod +x gradlew | |
| - name: Cache Gradle packages β»οΈ | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Lint with Detekt π¬ | |
| run: | | |
| ./gradlew lint sarifmerge | |
| - name: Upload Report Artifact β¬οΈ | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reports | |
| path: ./build/reports/detekt/all | |
| - name: Upload Merged Sarif Artifact β¬οΈ | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sarifmerge | |
| path: ./build/reports/sarifmerge | |
| - name: Upload SARIF file for GitHub Advanced Security π | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| # Path to SARIF file relative to the root of the repository | |
| sarif_file: ./build/reports/sarifmerge | |
| category: Detekt | |
| lint-ktlint: | |
| name: Lint using KtLint π¬ | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Setup KTlint π οΈ | |
| run: curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.1.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ | |
| - name: Lint with KtLint π¬ | |
| run: ktlint --reporter=sarif,,output=report.sarif | |
| continue-on-error: true | |
| - name: Fix Sarif file paths π οΈ | |
| run: sed -i 's|work/shake/shake/shake|shake|g' ./report.sarif | |
| - name: Upload Report Artifact β¬οΈ | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: reports | |
| path: ./report.sarif | |
| - name: Upload SARIF file for GitHub Advanced Security π | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| # Path to SARIF file relative to the root of the repository | |
| sarif_file: ./report.sarif | |
| category: KtLint |