-
Notifications
You must be signed in to change notification settings - Fork 22
151 lines (124 loc) · 4.13 KB
/
ci.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
name: YDB Java SDK CI with Maven
on:
push:
branches:
- master
- release*
pull_request:
type: [opened, reopened, edited, synchronize]
jobs:
prepare:
name: Prepare Maven cache
runs-on: ubuntu-latest
env:
MAVEN_ARGS: --batch-mode -Dstyle.color=always
steps:
- name: Checkout YDB Java SDK
uses: actions/checkout@v4
with:
path: sdk
- name: Checkout YDB YC Auth provider
uses: actions/checkout@v4
with:
repository: ydb-platform/ydb-java-yc
path: yc
- name: Checkout YDB JDBC Driver
uses: actions/checkout@v4
with:
repository: ydb-platform/ydb-jdbc-driver
path: jdbc
- name: Checkout YDB Java Examples
uses: actions/checkout@v4
with:
repository: ydb-platform/ydb-java-examples
path: examples
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
cache-dependency-path: |
sdk/pom.xml
sdk/bom/pom.xml
yc/pom.xml
jdbc/pom.xml
- name: Download YDB Java SDK dependencies
working-directory: ./sdk
run: mvn $MAVEN_ARGS dependency:go-offline
- name: Download YDB YC Auth provider dependencies
working-directory: ./yc
run: mvn $MAVEN_ARGS dependency:go-offline
- name: Download YDB JDBC Driver dependencies
working-directory: ./jdbc
run: mvn $MAVEN_ARGS dependency:go-offline
- name: Download YDB Java Examples dependencies
working-directory: ./examples
run: mvn $MAVEN_ARGS dependency:go-offline
build:
name: YDB Java SDK CI on JDK
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
java: [ '8', '11', '17']
env:
MAVEN_ARGS: --batch-mode -Dstyle.color=always -DYDB_DOCKER_ISOLATION=true
steps:
- name: Checkout YDB Java SDK
uses: actions/checkout@v4
with:
path: sdk
- name: Checkout YDB YC Auth provider
uses: actions/checkout@v4
with:
repository: ydb-platform/ydb-java-yc
path: yc
- name: Checkout YDB JDBC Driver
uses: actions/checkout@v4
with:
repository: ydb-platform/ydb-jdbc-driver
path: jdbc
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
cache-dependency-path: |
sdk/pom.xml
sdk/bom/pom.xml
yc/pom.xml
jdbc/pom.xml
- name: Extract YDB Java SDK version
working-directory: ./sdk
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "SDK_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Extract Auth API version
working-directory: ./sdk/auth-api
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "AUTH_API_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Build YDB Java SDK
working-directory: ./sdk
run: mvn $MAVEN_ARGS install
- name: Build YDB YC Auth provider
working-directory: ./yc
run: mvn $MAVEN_ARGS -Dydb.auth-api.version=$AUTH_API_VERSION install
- name: Extract YDB JDBC Driver version
working-directory: ./jdbc
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "JDBC_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Build YDB JDBC Driver with tests
working-directory: ./jdbc
run: mvn $MAVEN_ARGS -Dydb.sdk.version=$SDK_VERSION install
- name: Checkout YDB Java Examples
uses: actions/checkout@v4
with:
repository: ydb-platform/ydb-java-examples
path: examples
- name: Test examples with Maven
working-directory: ./examples
run: mvn $MAVEN_ARGS -Dydb.sdk.version=$SDK_VERSION -Dydb.jdbc.version=$JDBC_VERSION test