-
Notifications
You must be signed in to change notification settings - Fork 65
61 lines (51 loc) · 1.54 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
name: build
on:
push:
branches:
- main
paths:
- 'build.gradle.kts'
- 'gradle.properties'
- 'settings.gradle.kts'
- 'src/**'
- '**.yml'
pull_request:
branches:
- main
paths:
- 'build.gradle.kts'
- 'gradle.properties'
- 'settings.gradle.kts'
- 'src/**'
- '**.yml'
jobs:
build:
name: Java ${{ matrix.java-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java-version: [ 11, 17, 20 ]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
cache: 'gradle'
- name: Build and test on Ubuntu and macOS
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
run: ./gradlew check
- name: Build and test on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: gradlew.bat check
shell: cmd
- name: Create code coverage report
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java-version == '8' && github.event_name == 'push' }}
run: ./gradlew jacocoTestReport
- name: Upload code coverage report to Codecov
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java-version == '8' && github.event_name == 'push' }}
uses: codecov/codecov-action@v3