Skip to content

Commit

Permalink
Ktlint on other flows
Browse files Browse the repository at this point in the history
  • Loading branch information
alorma committed Jan 16, 2025
1 parent 4829168 commit e997b95
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 2 deletions.
37 changes: 36 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,46 @@ jobs:
checksSummary: full
failOnError: true

ktlint:
name: Ktlint - Release
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17

- name: Ktlint - Release
run: ./gradlew ktlintCheck

- name: Fix path in logs
uses: richardrigutins/replace-in-files@v2.1.9
if: ${{ !cancelled() }}
with:
files: ${{ github.workspace }}/**/build/reports/ktlint/**/*.xml
search-text: ${{ github.workspace }}/
replacement-text: ''

- name: Publish ktlint results
if: ${{ !cancelled()}}
uses: gmazzo/publish-report-annotations@v1.11.3
with:
reports: ${{ github.workspace }}/**/build/reports/ktlint/**/*.xml
checkName: Ktlint
token: ${{ github.token }}
workflowSummary: true
warningsAsErrors: false
checksSummary: full
failOnError: true

build-lib-base:
name: Build base - Release
if: ${{ success() }}
needs: [ detekt ]
needs: [ detekt, ktlint ]
runs-on: macos-latest
steps:
- name: Check out code
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,46 @@ jobs:
checksSummary: full
failOnError: true

ktlint:
name: Ktlint - PR
runs-on: macos-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17

- name: Ktlint - PR
run: ./gradlew ktlintCheck

- name: Fix path in logs
uses: richardrigutins/replace-in-files@v2.1.9
if: ${{ !cancelled() }}
with:
files: ${{ github.workspace }}/**/build/reports/ktlint/**/*.xml
search-text: ${{ github.workspace }}/
replacement-text: ''

- name: Publish ktlint results
if: ${{ !cancelled()}}
uses: gmazzo/publish-report-annotations@v1.11.3
with:
reports: ${{ github.workspace }}/**/build/reports/ktlint/**/*.xml
checkName: Ktlint
token: ${{ github.token }}
workflowSummary: true
warningsAsErrors: false
checksSummary: full
failOnError: true

build-lib-base:
name: Build base - PR
if: ${{ success() }}
needs: [ detekt ]
needs: [ detekt, ktlint ]
runs-on: macos-latest
steps:
- name: Check out code
Expand Down

0 comments on commit e997b95

Please sign in to comment.