Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0a17bf0

Browse files
committedJan 16, 2023
GHA replace ktlint with integrated detekt
1 parent 93acc76 commit 0a17bf0

File tree

3 files changed

+50
-32
lines changed

3 files changed

+50
-32
lines changed
 

‎.github/workflows/publish_snapshot.yml

+24-23
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,31 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
os: [macos-latest, windows-latest, ubuntu-latest]
14+
os: [ macos-latest, windows-latest, ubuntu-latest ]
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v2
1818

19-
- name: Publish Snapshot
20-
env:
21-
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
22-
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
23-
GPG_SECRET: ${{ secrets.GPG_SECRET }}
24-
GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
25-
SNAPSHOT: 'TRUE'
26-
run: ./gradlew publish
27-
28-
- name: Archive redux-kotlin publications dir
29-
uses: actions/upload-artifact@v1
30-
with:
31-
name: publications-${{ matrix.os }}
32-
path: redux-kotlin/build/publications
33-
34-
- name: Archive redux-kotlin-threadsafe publications dir
35-
if: steps.publish.outputsexit_code == 0
36-
uses: actions/upload-artifact@v1
37-
with:
38-
name: publications-threadsafe-${{ matrix.os }}
39-
path: redux-kotlin-threadsafe/build/publications
19+
# Disabling for now, CI will be updated in the followup PR
20+
# - name: Publish Snapshot
21+
# env:
22+
# SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
23+
# SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
24+
# GPG_SECRET: ${{ secrets.GPG_SECRET }}
25+
# GPG_SIGNING_PASSWORD: ${{ secrets.GPG_SIGNING_PASSWORD }}
26+
# SNAPSHOT: 'TRUE'
27+
# run: ./gradlew publish
28+
#
29+
# - name: Archive redux-kotlin publications dir
30+
# uses: actions/upload-artifact@v1
31+
# with:
32+
# name: publications-${{ matrix.os }}
33+
# path: redux-kotlin/build/publications
34+
#
35+
# - name: Archive redux-kotlin-threadsafe publications dir
36+
# if: steps.publish.outputsexit_code == 0
37+
# uses: actions/upload-artifact@v1
38+
# with:
39+
# name: publications-threadsafe-${{ matrix.os }}
40+
# path: redux-kotlin-threadsafe/build/publications
4041

‎.github/workflows/pull_request.yml

+26-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,37 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515

16-
- name: Ktlint
17-
uses: "vroy/gha-kotlin-linter@v1"
16+
- uses: actions/setup-java@v3
17+
with:
18+
distribution: 'adopt'
19+
java-version: 11
20+
21+
- name: Detekt
22+
run: ./gradlew detektAll
23+
24+
- name: Make artifact location URIs relative
25+
if: ${{ always() }}
26+
continue-on-error: true
27+
run: |
28+
ls '${{ github.workspace }}/build/reports/detekt/'
29+
cp '${{ github.workspace }}/build/reports/detekt/detekt.sarif' '${{ github.workspace }}/detekt.sarif.json'
30+
echo "$(
31+
jq --arg github_workspace ${{ github.workspace }} \
32+
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
33+
'${{ github.workspace }}/detekt.sarif.json'
34+
)" > '${{ github.workspace }}/detekt.sarif.json'
35+
36+
- uses: github/codeql-action/upload-sarif@v2
37+
if: ${{ always() }}
38+
with:
39+
sarif_file: ${{ github.workspace }}/detekt.sarif.json
40+
checkout_path: ${{ github.workspace }}
1841
test:
1942
needs: ktlint
2043
runs-on: ${{ matrix.os }}
2144
strategy:
2245
matrix:
23-
os: [macos-latest, windows-latest, ubuntu-latest]
46+
os: [ macos-latest, windows-latest, ubuntu-latest ]
2447
steps:
2548
- uses: actions/checkout@v2
2649

‎build-conventions/src/main/kotlin/convention.common.gradle.kts

-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ idea {
3434
}
3535
}
3636

37-
tasks {
38-
withType<Test> {
39-
// useJUnitPlatform()
40-
}
41-
}
42-
4337
afterEvaluate {
4438
tasks {
4539
if (findByName("compile") == null) {

0 commit comments

Comments
 (0)
Please sign in to comment.