Skip to content

Updated tests

Updated tests #46

Workflow file for this run

name: Build YDB JDBC Driver
on:
push:
branches:
- master
- develop
- release*
pull_request:
type: [opened, reopened, edited, synchronize]
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 -DYDB_DOCKER_ISOLATION=true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
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@v4
with:
repository: ydb-platform/ydb-java-sdk
ref: master
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@v4
with:
repository: ydb-platform/ydb-java-yc
ref: master
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:
if: github.repository == 'ydb-platform/ydb-jdbc-driver'
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@v4
- name: Set up JDK
uses: actions/setup-java@v4
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@v4
with:
repository: ydb-platform/ydb-java-sdk
ref: master
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@v4
with:
repository: ydb-platform/ydb-java-yc
ref: master
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@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}