-
Notifications
You must be signed in to change notification settings - Fork 10
57 lines (48 loc) · 1.42 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
name: Build
on:
push:
branches: [ main, '[1-9]+.[0-9]+.x' ]
pull_request:
branches: [ main, '[1-9]+.[0-9]+.x' ]
workflow_dispatch:
inputs:
commit_id:
description: 'Git commit id'
required: true
jobs:
build:
name: Gradle build on JDK ${{ matrix.java-version }}
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ '17', '21' ]
steps:
- name: Setup Commit ID
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "COMMIT_ID=${{ github.event.inputs.commit_id }}" >> ${GITHUB_ENV}
else
echo "COMMIT_ID=${{ github.sha }}" >> ${GITHUB_ENV}
fi
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ env.COMMIT_ID }}
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
cache: 'gradle'
- name: Run check
run: ./gradlew clean build
- name: Check coverage
run: ./gradlew koverMergedVerify
- name: Merge coverage reports
run: ./gradlew koverMergedReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: ${{ matrix.java-version == '17' && github.ref == 'refs/heads/main' }}
with:
files: ./build/kover/result.xml