-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (51 loc) · 1.65 KB
/
workflow-PR.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
name: workflow-pr
on:
pull_request:
branches: ["master", "support/*", "develop"]
paths-ignore:
- "**/README.md"
- "CONTRIBUTING.md"
- ".github/**"
- "!.github/workflows/workflow-PR.yml"
permissions:
checks: write
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17
cache: "maven"
- uses: Keeper-Security/ksm-action@v1
env:
KSM_CONFIG: ${{ secrets.KSM_CONFIG }}
if: ${{ env.KSM_CONFIG != '' }}
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |
${{ vars.KEEPER_SONARCLOUD_RECORD_ID }}/field/password > env:SONAR_TOKEN
- name: Build with Sonarcloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
if: ${{ env.SONAR_TOKEN != '' }}
run: ./mvnw -B -ntp clean verify sonar:sonar
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
if: ${{ env.SONAR_TOKEN == '' }}
run: ./mvnw -B -ntp clean verify
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: always() # always run even if the previous step fails
with:
report_paths: "**/target/*-reports/TEST-*.xml"