-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (43 loc) · 1.4 KB
/
diktat.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Run diKTat
on:
push:
branches: [ main ]
pull_request:
jobs:
diktat_check:
runs-on: ubuntu-20.04
env:
GRADLE_OPTS: -Dorg.gradle.daemon=false
steps:
- uses: actions/checkout@v2.4.0
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: zulu
- uses: gradle/gradle-build-action@v2
with:
gradle-version: wrapper
arguments: |
diktatCheck
-Pdiktat.githubActions=true
-Pdetekt.multiplatform.disabled=true
# Upload reports only if code style checks were failed
- name: Copy SARIF reports into a single directory
if: ${{ failure() }}
run: |
mkdir -p build/diktat-sarif-reports
i=0
find . -path "*/build/reports/diktat/*.sarif" | while read -r f; do echo "$f -> diktat-$i.sarif" && cp $f build/diktat-sarif-reports/diktat-$i.sarif || echo Cannot copy && echo Copied && i=$((i+1)); done
- name: Upload SARIF report to Github
uses: github/codeql-action/upload-sarif@v1
if: ${{ failure() }}
with:
sarif_file: build/diktat-sarif-reports
- name: Upload SARIF artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: sarif-reports
path: "**/build/diktat-sarif-reports/"
retention-days: 1