From 115140d01cfce19c27e0132f2eee42e2c94b7d9c Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Thu, 21 Sep 2023 19:06:33 +0200 Subject: [PATCH] ci: Run KTLint (#1825) * ci: Run ktlint * Update validate-android.yml * Update validate-android.yml * Update validate-android.yml * Use correct path * test: Use wrong Kotlin formatting * Use checkout@v4 * Revert "test: Use wrong Kotlin formatting" This reverts commit 282c23be9c40506f20f99f56f7166ea2fc8d45aa. --- .github/workflows/validate-android.yml | 29 ++++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/validate-android.yml b/.github/workflows/validate-android.yml index 6472b68..475883b 100644 --- a/.github/workflows/validate-android.yml +++ b/.github/workflows/validate-android.yml @@ -60,12 +60,23 @@ jobs: uses: yutailang0119/action-android-lint@v3 with: report-path: package/android/build/reports/*.xml - # ktlint: - # name: Kotlin Lint - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Run KTLint - # uses: mrousavy/action-ktlint@v1.7 - # with: - # github_token: ${{ secrets.github_token }} + ktlint: + name: Kotlin Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.0.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/ + - name: run ktlint + working-directory: ./package/android/ + run: | + ktlint --reporter=checkstyle,output=build/ktlint-report.xml --relative --editorconfig=./.editorconfig + continue-on-error: true + - uses: yutailang0119/action-ktlint@v3 + with: + report-path: ./package/android/build/*.xml + continue-on-error: false + - uses: actions/upload-artifact@v3 + with: + name: ktlint-report + path: ./package/android/build/*.xml