Skip to content

Commit

Permalink
Added CI github action
Browse files Browse the repository at this point in the history
  • Loading branch information
alex268 committed Sep 25, 2024
1 parent ff4b381 commit 2a78c96
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: YDB JDBC Driver CI

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 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: 8
distribution: 'temurin'
cache: 'maven'
cache-dependency-path: |
jdbc/pom.xml
- 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 JDBC Driver 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 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: |
jdbc/pom.xml
- 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
working-directory: ./jdbc
run: mvn $MAVEN_ARGS 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.jdbc.version=$JDBC_VERSION test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ydb-platform/ydb-jdbc-driver/blob/master/LICENSE)
[![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Ftech%2Fydb%2Fjdbc%2Fydb-jdbc-driver%2Fmaven-metadata.xml)](https://mvnrepository.com/artifact/tech.ydb.jdbc/ydb-jdbc-driver)
[![Build](https://img.shields.io/github/actions/workflow/status/ydb-platform/ydb-jdbc-driver/build.yaml)](https://github.com/ydb-platform/ydb-jdbc-driver/actions/workflows/build.yaml)
[![CI](https://img.shields.io/github/actions/workflow/status/ydb-platform/ydb-jdbc-driver/ci.yaml?label=CI)](https://github.com/ydb-platform/ydb-jdbc-driver/actions/workflows/ci.yaml)
[![Codecov](https://img.shields.io/codecov/c/github/ydb-platform/ydb-jdbc-driver)](https://app.codecov.io/gh/ydb-platform/ydb-jdbc-driver)

## JDBC Driver for YDB
Expand Down

0 comments on commit 2a78c96

Please sign in to comment.