-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (61 loc) · 1.73 KB
/
build-java.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
name: Java
on:
workflow_call:
workflow_dispatch:
pull_request:
paths:
- "java/**"
- "proto/**"
- ".github/workflows/*java*"
- "devops/**"
push:
branches:
- main
paths:
- "java/**"
- "proto/**"
- ".github/workflows/*java*"
- "devops/**"
jobs:
build-and-test-java:
name: Build, Test
runs-on: ${{ matrix.os-artifact[0] }}
strategy:
fail-fast: false
matrix:
os-artifact: [ [ubuntu-latest, linux], [windows-latest, windows], [macos-latest, macos] ]
java-version: [ '11', '16', '17' ]
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: 'gradle'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Download workflow artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: "build-libs.yml"
path: ./libs/${{ matrix.os-artifact[1] }}
github_token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ matrix.os-artifact[1] }}
- name: Build with Gradle
run: |
python ../devops/build_sdks.py --language=java
gradle build
shell: pwsh
working-directory: java
env:
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
OKAPI_LIBRARY_PATH: "${{ github.workspace }}/libs"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
directory: java/build/reports/jacoco/test
token: ${{ secrets.CODECOV_TOKEN }}