-
Notifications
You must be signed in to change notification settings - Fork 6
153 lines (122 loc) · 3.87 KB
/
build.yaml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: Build YDB JDBC Driver
on:
push:
branches:
- master
- develop
- release*
pull_request:
type: [opened, reopened, edited]
jobs:
build:
name: Build JDBC Driver
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11', '17']
env:
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
- name: Extract SDK version
run: |
VERSION=$(mvn help:evaluate -Dexpression=ydb.sdk.version -q -DforceStdout)
echo "SDK_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Check SDK version
run: |
echo "NEED_SDK=${{ endsWith(env.SDK_VERSION, 'SNAPSHOT') }}" >> "$GITHUB_ENV"
- name: Checkout YDB Java SDK
if: env.NEED_SDK == 'true'
uses: actions/checkout@v3
with:
repository: ydb-platform/ydb-java-sdk
ref: develop
path: ydb-java-sdk
- name: Build YDB Java SDK
working-directory: ./ydb-java-sdk
if: env.NEED_SDK == 'true'
run: mvn $MAVEN_ARGS install
- name: Remove YDB Java SDK
if: env.NEED_SDK == 'true'
run: rm -rf ydb-java-sdk
- name: Checkout YC Auth provider
if: env.NEED_SDK == 'true'
uses: actions/checkout@v3
with:
repository: ydb-platform/ydb-java-yc
ref: develop
path: yc
- name: Build YC Auth provider
working-directory: ./yc
if: env.NEED_SDK == 'true'
run: mvn $MAVEN_ARGS install
- name: Remove YC Auth provider
if: env.NEED_SDK == 'true'
run: rm -rf yc
- name: Download dependencies
run: mvn $MAVEN_ARGS dependency:resolve-plugins dependency:go-offline
- name: Build with Maven
run: mvn $MAVEN_ARGS package
coverage:
name: Coverage JDBC Driver
runs-on: ubuntu-latest
needs: build
env:
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'temurin'
cache: 'maven'
- name: Extract SDK version
run: |
VERSION=$(mvn help:evaluate -Dexpression=ydb.sdk.version -q -DforceStdout)
echo "SDK_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Check SDK version
run: |
echo "NEED_SDK=${{ endsWith(env.SDK_VERSION, 'SNAPSHOT') }}" >> "$GITHUB_ENV"
- name: Checkout YDB Java SDK
if: env.NEED_SDK == 'true'
uses: actions/checkout@v3
with:
repository: ydb-platform/ydb-java-sdk
ref: develop
path: ydb-java-sdk
- name: Build YDB Java SDK
working-directory: ./ydb-java-sdk
if: env.NEED_SDK == 'true'
run: mvn $MAVEN_ARGS install
- name: Remove YDB Java SDK
if: env.NEED_SDK == 'true'
run: rm -rf ydb-java-sdk
- name: Checkout YC Auth provider
if: env.NEED_SDK == 'true'
uses: actions/checkout@v3
with:
repository: ydb-platform/ydb-java-yc
ref: develop
path: yc
- name: Build YC Auth provider
working-directory: ./yc
if: env.NEED_SDK == 'true'
run: mvn $MAVEN_ARGS install
- name: Remove YC Auth provider
if: env.NEED_SDK == 'true'
run: rm -rf yc
- name: Download dependencies
run: mvn $MAVEN_ARGS dependency:resolve-plugins dependency:go-offline
- name: Build with Maven
run: mvn $MAVEN_ARGS test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3