Skip to content

Commit

Permalink
chore: enable linux tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc-bq committed Jun 18, 2024
1 parent feee461 commit aa9bb60
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 93 deletions.
182 changes: 91 additions & 91 deletions .github/workflows/failover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,97 +120,97 @@ jobs:
name: windows-failover-results
path: ${{ github.workspace }}/build/unit_testing/Testing/Temporary/LastTest.log

# build-linux:
# name: Linux
# runs-on: ubuntu-latest
# env:
# CMAKE_GENERATOR: Unix Makefiles
# CXX: g++-11
# steps:
# - name: Checkout source code
# uses: actions/checkout@v4
#
# # Configure build environment/dependencies
# - name: Install build dependencies
# run: sudo apt-get update && sudo apt-get install
# g++-11
# build-essential
# libgtk-3-dev
# unixodbc
# unixodbc-dev
# libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev # AWS SDK dependencies
#
# - name: Install MySQL client libs and include files
# run: |
# curl -L https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${{ vars.MYSQL_VERSION }}-linux-glibc2.28-x86_64.tar.xz -o mysql.tar.gz
# tar xf mysql.tar.gz
#
# - name: Cache AWS SDK libraries
# id: cache-dynamic-aws-sdk
# uses: actions/cache@v4
# with:
# path: |
# aws_sdk
# key: ${{ runner.os }}-aws-sdk-dynamic-lib
#
# - name: Build and install AWS SDK C++
# working-directory: ./scripts
# if: steps.cache-dynamic-aws-sdk.outputs.cache-hit != 'true'
# run: |
# ./build_aws_sdk_unix.sh $LINUX_BUILD_TYPE
#
# - name: Create build environment
# shell: bash
# run: cmake -E make_directory ${{ github.workspace }}/build
#
# - name: Configure CMake
# shell: bash
# run: cmake -S . -B build
# -G "$CMAKE_GENERATOR"
# -DCMAKE_BUILD_TYPE=$LINUX_BUILD_TYPE
# -DMYSQLCLIENT_STATIC_LINKING=true
# -DWITH_UNIXODBC=1
# -DCONNECTOR_PLATFORM=linux
# -DMYSQL_DIR=./mysql-${{ vars.MYSQL_VERSION }}-linux-glibc2.28-x86_64/
# -DENABLE_UNIT_TESTS=TRUE
# -DENABLE_INTEGRATION_TESTS=FALSE
#
# - name: copy AWS SDK libraries to driver library
# run: |
# cp ./aws_sdk/install/lib/*.so ./build/lib/
#
# # Build driver
# - name: Build driver
# working-directory: ${{ github.workspace }}/build
# shell: bash
# run: make -j4
#
# # Test driver
# - name: Run failover tests on Linux
# if: success()
# working-directory: ${{ github.workspace }}/build/unit_testing
# shell: bash
# run: ctest --output-on-failure
#
# # Upload artifacts
# - name: Upload build artifacts - Binaries
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: linux-failover-binaries
# path: ${{ github.workspace }}/build/bin/
# - name: Upload build artifacts - Libraries
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: linux-failover-libraries
# path: ${{ github.workspace }}/build/lib/
# - name: Upload test artifacts
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: linux-failover-results
# path: ${{ github.workspace }}/build/unit_testing/Testing/Temporary/LastTest.log
build-linux:
name: Linux
runs-on: ubuntu-latest
env:
CMAKE_GENERATOR: Unix Makefiles
CXX: g++-11
steps:
- name: Checkout source code
uses: actions/checkout@v4

# Configure build environment/dependencies
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install
g++-11
build-essential
libgtk-3-dev
unixodbc
unixodbc-dev
libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev # AWS SDK dependencies

- name: Install MySQL client libs and include files
run: |
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${{ vars.MYSQL_VERSION }}-linux-glibc2.28-x86_64.tar.xz -o mysql.tar.gz
tar xf mysql.tar.gz
- name: Cache AWS SDK libraries
id: cache-dynamic-aws-sdk
uses: actions/cache@v4
with:
path: |
aws_sdk
key: ${{ runner.os }}-aws-sdk-dynamic-lib

- name: Build and install AWS SDK C++
working-directory: ./scripts
if: steps.cache-dynamic-aws-sdk.outputs.cache-hit != 'true'
run: |
./build_aws_sdk_unix.sh $LINUX_BUILD_TYPE
- name: Create build environment
shell: bash
run: cmake -E make_directory ${{ github.workspace }}/build

- name: Configure CMake
shell: bash
run: cmake -S . -B build
-G "$CMAKE_GENERATOR"
-DCMAKE_BUILD_TYPE=$LINUX_BUILD_TYPE
-DMYSQLCLIENT_STATIC_LINKING=true
-DWITH_UNIXODBC=1
-DCONNECTOR_PLATFORM=linux
-DMYSQL_DIR=./mysql-${{ vars.MYSQL_VERSION }}-linux-glibc2.28-x86_64/
-DENABLE_UNIT_TESTS=TRUE
-DENABLE_INTEGRATION_TESTS=FALSE

- name: copy AWS SDK libraries to driver library
run: |
cp ./aws_sdk/install/lib/*.so ./build/lib/
# Build driver
- name: Build driver
working-directory: ${{ github.workspace }}/build
shell: bash
run: make -j4

# Test driver
- name: Run failover tests on Linux
if: success()
working-directory: ${{ github.workspace }}/build/unit_testing
shell: bash
run: ctest --output-on-failure

# Upload artifacts
- name: Upload build artifacts - Binaries
if: always()
uses: actions/upload-artifact@v4
with:
name: linux-failover-binaries
path: ${{ github.workspace }}/build/bin/
- name: Upload build artifacts - Libraries
if: always()
uses: actions/upload-artifact@v2
with:
name: linux-failover-libraries
path: ${{ github.workspace }}/build/lib/
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: linux-failover-results
path: ${{ github.workspace }}/build/unit_testing/Testing/Temporary/LastTest.log

build-mac:
name: MacOS
Expand Down
2 changes: 1 addition & 1 deletion driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ WHILE(${DRIVER_INDEX} LESS ${DRIVERS_COUNT})
ADD_LIBRARY(${DRIVER_NAME_STATIC} STATIC ${DRIVER_SRCS} ${AWSSDK_LIB_DIR})
ADD_LIBRARY(${DRIVER_NAME} SHARED ${DRIVER_SRCS} ${AWSSDK_LIB_DIR})

ADD_LIBRARY(${DRIVER_NAME} MODULE ${DRIVER_SRCS})
ADD_LIBRARY(${DRIVER_NAME} MODULE ${DRIVER_SRCS} ${AWSSDK_LIB_DIR})

add_version_info(${DRIVER_NAME}
"AWS ODBC ${DRIVER_TYPE} Driver For MySQL."
Expand Down
2 changes: 1 addition & 1 deletion setupgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ add_version_info(awsmysqlodbcS
"Provides driver configuration GUI."
)

target_link_libraries(myodbc8S ${ODBCLIB} ${ODBCINSTLIB} otel_api)
target_link_libraries(awsmysqlodbcS ${ODBCLIB} ${ODBCINSTLIB} otel_api)

# Note: When using GTK+, these libraries will be linked to -gtk modules.

Expand Down

0 comments on commit aa9bb60

Please sign in to comment.