-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (80 loc) · 2.34 KB
/
ci.yml
File metadata and controls
99 lines (80 loc) · 2.34 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
name: CI
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
workflow_dispatch:
jobs:
build:
name: Build and Test (Java ${{ matrix.java }})
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
strategy:
matrix:
java: [ '21', '22', '23' ]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --no-daemon --stacktrace
- name: Run tests
run: ./gradlew test --no-daemon --stacktrace
- name: Generate code coverage report
if: matrix.java == '21'
run: ./gradlew jacocoTestReport --no-daemon
- name: Upload coverage to Codecov
if: matrix.java == '21'
uses: codecov/codecov-action@v5
with:
files: ./build/reports/jacoco/test/jacocoTestReport.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Archive test results
if: always()
uses: actions/upload-artifact@v6
with:
name: test-results-java-${{ matrix.java }}
path: |
**/build/reports/tests/
**/build/test-results/
retention-days: 7
- name: Archive code coverage results
if: matrix.java == '21'
uses: actions/upload-artifact@v6
with:
name: code-coverage-report
path: build/reports/jacoco/
retention-days: 7
# Job for dependency vulnerability scanning
dependency-check:
name: Dependency Security Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run dependency check
run: ./gradlew dependencies --no-daemon