-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (84 loc) · 3.2 KB
/
Copy pathbuild-and-quality-checks.yml
File metadata and controls
101 lines (84 loc) · 3.2 KB
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
97
98
99
100
101
name: Build & Code Quality Checks
on:
pull_request:
branches: [ 'master', 'develop' ]
types: [ 'opened', 'reopened', 'synchronize' ]
jobs:
unit_test_and_build:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
- name: Set up Maven
uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f # v4.5
with:
maven-version: 3.8.6
- name: Cache local Maven repository
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3.5.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Cache SonarCloud packages
uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3.5.0
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
- name: Setup
run: mvn clean && mvn templating:filter-sources
- name: Unit Test and Build
run: mvn clean install
# - name: Jacoco Badge generator
# uses: cicirello/jacoco-badge-generator@v2
# with:
# generate-summary: true
# jacoco-csv-file: analytics-cli/target/site/jacoco-aggregate/jacoco.csv
#
# - name: Commit and push the badge (if it changed)
# uses: EndBug/add-and-commit@v9.1.1
# with:
# default_author: github_actions
# message: 'commit badge'
# add: '*.svg'
- name: Upload coverage report
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: Coverage report
path: |
analytics-cli/target/site/jacoco-aggregate/
- name: PMD lint checking
run: |
mvn pmd:pmd
mvn pmd:cpd
- name: Upload PMD lint report
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: PMD lint report
path: |
analytics-core/target/site
analytics/target/site
- name: Checkstyle lint checking
run: mvn checkstyle:checkstyle
- name: Upload Checklist lint report
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: Checklist lint report
path: |
analytics-core/target/site
analytics/target/site
- name: Sonar analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=rudderlabs_rudder-sdk-java