-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (64 loc) · 1.89 KB
/
check.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
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
name: Check
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
jobs:
build:
strategy:
matrix:
jdk: [21]
runs-on: ubuntu-latest
env:
JDK_VERSION: ${{ matrix.jdk }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Gradle wrapper validation
uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache global .gradle folder
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: global-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.kt*') }}-${{ hashFiles('**/*.java') }}
restore-keys: |
gradle-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Download postgres
run: docker pull postgres:15.4
- name: Setup gradle
uses: gradle/actions/setup-gradle@v4
- name: Run build
run: ./gradlew check detekt mergeDetektSarif :gradle-plugins:buildPlugins --continue
- name: Upload sarif file to GitHub
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: build/detekt-merged.sarif
category: detekt
- name: Upload failure artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: reports
path: '**/build/reports'