66
77concurrency :
88 cancel-in-progress : true
9- group : ${{ github.workflow }}-${{ github.head_ref || github.ref }}
9+ group : check- ${{ github.workflow }}-${{ github.head_ref || github.ref }}
1010
1111env :
1212 GRADLE_OPTS : " -Dorg.gradle.daemon=true"
1313
1414jobs :
15+ lint :
16+ name : Lint the code
17+ runs-on : ubuntu-latest
18+ env :
19+ GRADLE_OPTS : " -Dorg.gradle.daemon=false"
20+ steps :
21+ - uses : actions/checkout@v3
22+
23+ - uses : actions/setup-java@v3
24+ with :
25+ distribution : ' adopt'
26+ java-version : 11
27+
28+ - name : Restore Gradle cache
29+ id : cache-gradle
30+ uses : actions/cache@v3
31+ with :
32+ path : |
33+ ~/.gradle/caches
34+ ~/.gradle/wrapper
35+ ~/.gradle/yarn
36+ ~/.gradle/nodejs
37+ ~/.konan
38+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
39+ restore-keys : ${{ runner.os }}-gradle-
40+
41+ - name : Run detekt
42+ run : ./gradlew detektAll
43+
44+ - name : Make artifact location URIs relative
45+ if : ${{ always() }}
46+ continue-on-error : true
47+ run : |
48+ ls '${{ github.workspace }}/build/reports/detekt/'
49+ cp '${{ github.workspace }}/build/reports/detekt/detekt.sarif' '${{ github.workspace }}/detekt.sarif.json'
50+ echo "$(
51+ jq --arg github_workspace ${{ github.workspace }} \
52+ '. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
53+ '${{ github.workspace }}/detekt.sarif.json'
54+ )" > '${{ github.workspace }}/detekt.sarif.json'
55+
56+ - uses : github/codeql-action/upload-sarif@v2
57+ if : ${{ always() }}
58+ with :
59+ sarif_file : ${{ github.workspace }}/detekt.sarif.json
60+ checkout_path : ${{ github.workspace }}
61+
1562 check :
1663 name : Check on ${{ matrix.os.runner }}
1764 runs-on : ${{ matrix.os.runner }}
@@ -22,12 +69,12 @@ jobs:
2269 fail-fast : false
2370 matrix :
2471 os :
25- # - runner: macos-latest
26- # shell: bash
27- # separator: '/'
2872 - runner : ubuntu-latest
2973 shell : bash
3074 separator : ' /'
75+ # - runner: macos-latest
76+ # shell: bash
77+ # separator: '/'
3178# - runner: windows-latest
3279# shell: msys2 {0}
3380# separator: '\'
@@ -67,25 +114,10 @@ jobs:
67114 run : ./gradlew compile assemble --scan
68115
69116 - name : Gradle Check
70- run : ./gradlew check --scan
117+ run : ./gradlew check -x detekt -x detektAll - -scan
71118
72- - name : Make artifact location URIs relative
73- if : ${{ always() }}
74- continue-on-error : true
75- run : |
76- ls '${{ github.workspace }}${{ matrix.os.separator }}build${{ matrix.os.separator }}reports${{ matrix.os.separator }}detekt${{ matrix.os.separator }}'
77- cp '${{ github.workspace }}${{ matrix.os.separator }}build${{ matrix.os.separator }}reports${{ matrix.os.separator }}detekt${{ matrix.os.separator }}detekt.sarif' '${{ github.workspace }}${{ matrix.os.separator }}detekt.sarif.json'
78- echo "$(
79- jq --arg github_workspace ${{ github.workspace }} \
80- '. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
81- '${{ github.workspace }}${{ matrix.os.separator }}detekt.sarif.json'
82- )" > '${{ github.workspace }}${{ matrix.os.separator }}detekt.sarif.json'
83-
84- - uses : github/codeql-action/upload-sarif@v2
85- if : ${{ always() }}
86- with :
87- sarif_file : ${{ github.workspace }}${{ matrix.os.separator }}detekt.sarif.json
88- checkout_path : ${{ github.workspace }}
119+ - name : Gradle Test Local Publishing
120+ run : ./gradlew publishToLocal --scan
89121
90122 - uses : actions/upload-artifact@v3
91123 if : ${{ always() }}
0 commit comments