Skip to content

Commit

Permalink
feat: add kotlin linting workflow
Browse files Browse the repository at this point in the history
feat: add kotlin linting workflow
  • Loading branch information
ItsAbhinavM committed Aug 27, 2024
1 parent f8df5f9 commit 2730a15
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pr_kotlinlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: pr_kotlinlint
on:
pull_request:
branches:
- main
types: [opened, reopened, synchronize]

jobs:
lint:
name: Run KotlinLint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'

- name: Install ktlint
run: curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.45.2/ktlint && chmod a+x ktlint

- name: Run ktlint
run: ./ktlint --relative "**/*.kt" --reporter=checkstyle,output=ktlint-checkstyle-report.xml || echo "ktlint found issues"

- name: Upload lint reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: lint-results
path: ./ktlint-checkstyle-report.xml

0 comments on commit 2730a15

Please sign in to comment.