diff --git a/.github/workflows/pr_kotlinlint.yaml b/.github/workflows/pr_kotlinlint.yaml new file mode 100644 index 00000000..9936bb88 --- /dev/null +++ b/.github/workflows/pr_kotlinlint.yaml @@ -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