Skip to content

chore: rebase upstream changes from 8.3.0 #1313

chore: rebase upstream changes from 8.3.0

chore: rebase upstream changes from 8.3.0 #1313

Workflow file for this run

name: Community Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- '*'
paths-ignore:
- '**/*.md'
- '**/*.jpg'
- '**/README.txt'
- '**/LICENSE.txt'
- 'docs/**'
- 'ISSUE_TEMPLATE/**'
- '**/remove-old-artifacts.yml'
env:
BUILD_TYPE: Release
jobs:
build-windows:
name: Windows
runs-on: windows-latest
env:
CMAKE_GENERATOR: Visual Studio 17 2022
MYSQL_DIR: C:/mysql-${{ vars.MYSQL_VERSION }}-winx64
steps:
- name: Checkout source code
uses: actions/checkout@v4
# Configure build environment/dependencies
- name: Install MySQL client libs
run: |
curl -L https://dev.mysql.com/get/Downloads/MySQL-8.3/mysql-${{ vars.MYSQL_VERSION }}-winx64.zip -o mysql.zip
unzip -d C:/ mysql.zip
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- 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_win.ps1 x64 ${{ env.BUILD_TYPE}} ON "${{env.CMAKE_GENERATOR}}"
- 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"
-DMYSQL_SQL="C:/mysql-${{ vars.MYSQL_VERSION }}-winx64"
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DMYSQLCLIENT_STATIC_LINKING=TRUE
# Configure test environment
- name: Build Driver and Copy files
shell: bash
working-directory: ${{ github.workspace }}/build
run: |
cmake --build . --config $BUILD_TYPE
cp -r lib/Release/* C:/Windows/System32/
cp -r bin/Release/* C:/Windows/System32/
- name: Add DSN to registry
shell: bash
working-directory: C:/Windows/System32
run: |
./myodbc-installer -d -a -n "AWS ODBC Driver for MySQL" -t "DRIVER=awsmysqlodbca.dll;SETUP=awsmysqlodbcS.dll"
./myodbc-installer -s -a -c2 -n "test" -t "DRIVER=AWS ODBC Driver for MySQL;SERVER=localhost;DATABASE=test;UID=root;PWD="
- name: Start MySQL server for tests
if: success()
shell: bash
run: |
$MYSQL_DIR/bin/mysqld --initialize-insecure --console
$MYSQL_DIR/bin/mysqld --console &
sleep 20
$MYSQL_DIR/bin/mysql -u root -e "create database test"
# Test driver
- name: Run community tests
if: success()
working-directory: ${{ github.workspace }}/build/test
shell: bash
run: ctest -C $BUILD_TYPE --output-on-failure
env:
TEST_DSN: test
TEST_UID: root
TEST_DATABASE: test
TEST_DRIVER: AWS ODBC Driver for MySQL
# Upload artifacts
- name: Upload build artifacts - Binaries
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-sln
path: ${{ github.workspace }}/build/MySQL_Connector_ODBC.sln
- name: Upload build artifacts - Binaries
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-binaries
path: ${{ github.workspace }}/build/bin/
- name: Upload build artifacts - Libraries
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-community-libraries
path: ${{ github.workspace }}/build/lib/
- name: Upload community test artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-community-results
path: ${{ github.workspace }}/build/test/Testing/Temporary/LastTest.log
# build-mac:
# name: MacOS
# runs-on: macos-13
# env:
# CMAKE_GENERATOR: Unix Makefiles
# ODBC_DM_INCLUDES: /usr/local/include
# steps:
# - name: Checkout source code
# uses: actions/checkout@v4
#
# # Configure build environment/dependencies
# # Removing some /usr/local/bin files to avoid symlink issues wih brew update
# - name: Install MySQL client libs & other dependencies
# run: |
# rm '/usr/local/bin/2to3'
# rm '/usr/local/bin/2to3-3.11'
# rm '/usr/local/bin/idle3'
# rm '/usr/local/bin/idle3.11'
# rm '/usr/local/bin/pydoc3'
# rm '/usr/local/bin/pydoc3.11'
# rm '/usr/local/bin/python3'
# rm '/usr/local/bin/python3-config'
# rm '/usr/local/bin/python3.11'
# rm '/usr/local/bin/python3.11-config'
#
# brew update
# brew unlink unixodbc
# brew install libiodbc mysql@8.3 mysql-client@8.3
# brew link --overwrite --force libiodbc
# brew link --overwrite --force mysql@8.3
# echo 'export PATH="/usr/local/opt/mysql@8.3/bin:$PATH"' >> /Users/runner/.bash_profile
# echo 'export PATH="/usr/local/opt/mysql-client@8.3/bin:$PATH"' >> /Users/runner/.bash_profile
#
# brew install openssl@3
# rm -f /usr/local/lib/libssl.3.dylib
# rm -f /usr/local/lib/libcrypto.3.dylib
# ln -s /usr/local/opt/openssl@3/lib/libssl.3.dylib /usr/local/lib/
# ln -s /usr/local/opt/openssl@3/lib/libcrypto.3.dylib /usr/local/lib/
#
# source /Users/runner/.bash_profile
#
# curl -L https://dev.mysql.com/get/Downloads/MySQL-8.3/mysql-${{ vars.MYSQL_VERSION }}-macos14-x86_64.tar.gz -o mysql.tar.gz
# tar -xzvf 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 $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=$BUILD_TYPE
# -DMYSQLCLIENT_STATIC_LINKING=true
# -DODBC_INCLUDES=$ODBC_DM_INCLUDES
# -DMYSQL_DIR=./mysql-${{ vars.MYSQL_VERSION }}-macos14-x86_64
#
# # Build driver
# - name: Build driver
# working-directory: ${{ github.workspace }}/build
# shell: bash
# run: |
# export LIBRARY_PATH=$LIBRARY_PATH:$(brew --prefix zstd)/lib/
# export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib/
# cmake --build .
# ln -s /usr/local/opt/openssl@3/lib/libssl.3.dylib /Users/runner/work/aws-mysql-odbc/aws-mysql-odbc/build/lib/
# ln -s /usr/local/opt/openssl@3/lib/libcrypto.3.dylib /Users/runner/work/aws-mysql-odbc/aws-mysql-odbc/build/lib/
#
# - name: copy AWS SDK libraries to driver library
# run: |
# cp ./aws_sdk/install/lib/*.dylib ./build/lib/
#
# # Configure test environment
# - name: Start MySQL server for tests
# if: success()
# working-directory: ${{ github.workspace }}/test/docker
# shell: bash
# run: |
# mysql.server start
# mysql -u root -e "create database test"
#
# # Test driver
# - name: Run driver tests
# if: success()
# working-directory: ${{ github.workspace }}/build/test
# shell: bash
# run: |
# ctest --output-on-failure
# env:
# TEST_DSN: awsmysqlodbca
# TEST_UID: root
# TEST_PASSWORD:
# TEST_DRIVER: ${{ github.workspace }}/build/lib/awsmysqlodbca.dylib
# ODBCINI: ${{ github.workspace }}/build/test/odbc.ini
# ODBCINSTINI: ${{ github.workspace }}/build/test/odbcinst.ini
#
# # Upload artifacts
# - name: Upload build artifacts - Binaries
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: macos-community-binaries
# path: ${{ github.workspace }}/build/bin/
# - name: Upload build artifacts - Libraries
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: macos-libraries
# path: ${{ github.workspace }}/build/lib/
# - name: Upload test artifacts
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: macos-community-results
# path: ${{ github.workspace }}/build/test/Testing/Temporary/LastTest.log