Skip to content
This repository was archived by the owner on Aug 3, 2025. It is now read-only.

Lint

Lint #1677

Workflow file for this run

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