From 2730a15e62f816b4689f831146cfcb75273408d5 Mon Sep 17 00:00:00 2001 From: ItsAbhinavM Date: Tue, 27 Aug 2024 18:37:08 +0530 Subject: [PATCH 1/2] feat: add kotlin linting workflow feat: add kotlin linting workflow --- .github/workflows/pr_kotlinlint.yaml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/pr_kotlinlint.yaml diff --git a/.github/workflows/pr_kotlinlint.yaml b/.github/workflows/pr_kotlinlint.yaml new file mode 100644 index 00000000..21c5e934 --- /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 \ No newline at end of file From 914c75e1fadfd12357c949b92f7dc68b4f7ba881 Mon Sep 17 00:00:00 2001 From: Andrew Tavis McAllister Date: Wed, 28 Aug 2024 22:15:07 +0200 Subject: [PATCH 2/2] Minor fix to add missing EOF line --- .github/workflows/pr_kotlinlint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_kotlinlint.yaml b/.github/workflows/pr_kotlinlint.yaml index 21c5e934..9936bb88 100644 --- a/.github/workflows/pr_kotlinlint.yaml +++ b/.github/workflows/pr_kotlinlint.yaml @@ -31,4 +31,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: lint-results - path: ./ktlint-checkstyle-report.xml \ No newline at end of file + path: ./ktlint-checkstyle-report.xml