-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (82 loc) · 2.6 KB
/
build.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
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 on PR
on:
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build on Java ${{ matrix.java }}
runs-on: ubuntu-latest
strategy:
matrix:
java: ["8", "11", "17", "21"]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java }}
- name: Setup Gradle and publish build scans
uses: gradle/actions/setup-gradle@v3
with:
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set TERM variable for gradle
run: echo "TERM=dumb" >> $GITHUB_ENV
- name: Display environment info
run: |
./gradlew -v
uname -a
- name: Clean previous gradle builds
run: ./gradlew clean -q -S
- name: Build using gradle
run: ./gradlew build -q -S
- name: Remove Gradle cache lock file
if: always()
run: rm -rvf $HOME/.gradle/caches/modules-2/modules-2.lock
test:
needs: build
name: Test on Java 17
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Setup Gradle and publish build scans
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set TERM variable for gradle
run: echo "TERM=dumb" >> $GITHUB_ENV
- name: Display environment info
run: |
./gradlew -v
uname -a
- name: Run tests with Gradle wrapper
run: ./gradlew test -S
- name: Remove Gradle cache lock file
if: always()
run: rm -rvf $HOME/.gradle/caches/modules-2/modules-2.lock
review:
needs: test
name: Code Review
runs-on: ubuntu-latest
steps:
- name: Code coverage reports by Codecov
uses: codecov/codecov-action@v4.0.1
with:
name: Branch Coverage
token: ${{ secrets.CODECOV_TOKEN }}
slug: VenomVendor/NullDefense
file: ./build/reports/jacoco/report.xml
fail_ci_if_error: true