-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (84 loc) · 2.46 KB
/
ci.yml
File metadata and controls
97 lines (84 loc) · 2.46 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
name: CI
# workflow triggers
on:
# manually
workflow_dispatch:
# PRs on `main`
pull_request:
branches:
- main
- develop
# nightly
schedule:
- cron: "0 3 * * *"
jobs:
verify:
name: Verify build on ubuntu-latest
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v5.0.0
- name: Setup Java and Maven cache
uses: actions/setup-java@v4.7.1
with:
distribution: 'temurin'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Verify build
run: >
./mvnw clean verify
--batch-mode
--update-snapshots
--no-transfer-progress
- name: Stage build results (Unix)
run: mkdir staging-ubuntu-latest && find . -path '*/target/*.jar' -exec cp {} staging-ubuntu-latest/ \;
- name: Upload build results
uses: actions/upload-artifact@v4
with:
name: build-results-ubuntu-latest
path: staging-ubuntu-latest
sonar:
name: SonarQube analysis
runs-on: ubuntu-latest
needs: [verify]
if: github.event_name == 'schedule' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
strategy:
fail-fast: true
steps:
- name: Checkout repository
uses: actions/checkout@v5.0.0
- name: Setup Java and Maven cache
uses: actions/setup-java@v4.7.1
with:
distribution: 'temurin'
java-version: '17'
check-latest: true
cache: 'maven'
- name: Run SonarQube analysis
run: >
./mvnw clean verify sonar:sonar -P coverage
--batch-mode
--update-snapshots
--no-transfer-progress
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run-checkstyle:
name: checkstyle check
runs-on: ubuntu-latest
needs: [ verify ]
if: (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
strategy:
fail-fast: true
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Run checkstyle
uses: dbelyaev/action-checkstyle@v2.0.0
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
checkstyle_config: checkstyle.xml
checkstyle_version: "10.21.4"