-
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (82 loc) · 2.39 KB
/
lint.yaml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Lint
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
schedule:
# Run every monday at 12:00 UTC
- cron: 0 12 * * 1
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language:
- java
steps:
- uses: actions/checkout@v3
with:
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
# CodeQL currently does not yet support Kotlin 1.8
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v2
# with:
# languages: ${{ matrix.language }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Cache Sonar
uses: actions/cache@v3
with:
path: |
~/.sonar/cache
key: cache-${{ runner.os }}-sonar
restore-keys: |
cache-${{ runner.os }}-sonar
- name: Cache ForgeGradle
uses: actions/cache@v3
with:
path: |
build/fg_cache
key: cache-${{ runner.os }}-forgegradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'buildSrc/**/Versions.kt', 'buildSrc/**/Dependencies.kt', 'gradle/*.versions.toml') }}
restore-keys: |
cache-${{ runner.os }}-forgegradle-
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
- name: Perform Detekt analysis
uses: gradle/gradle-build-action@v2
with:
arguments: detekt
- name: Upload Detekt SARIF report
uses: github/codeql-action/upload-sarif@v2
if: ${{ always() }}
with:
sarif_file: build/reports/detekt/detekt.sarif
- name: Perform Sonar analysis
uses: gradle/gradle-build-action@v2
with:
arguments: sonar --info
env:
# Needed to get PR information
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# - name: Perform CodeQL analysis
# uses: github/codeql-action/analyze@v2
# with:
# category: "/language:${{matrix.language}}"