-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from Bit-Quill/integrate-mirror
Integrate mirror
- Loading branch information
Showing
471 changed files
with
70,684 additions
and
72,963 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
name: ODBC Driver for Linux | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
env: | ||
CI_OUTPUT_PATH: "ci-output" | ||
ODBC_LIB_PATH: "${{github.workspace}}/build/odbc/lib" | ||
ODBC_BIN_PATH: "${{github.workspace}}/build/odbc/bin" | ||
ODBC_BUILD_PATH: "${{github.workspace}}/build/odbc/build" | ||
DOCUMENTDB_HOME: "${{github.workspace}}/build/odbc/bin" | ||
DOC_DB_KEYPAIR: ${{secrets.DOC_DB_KEYPAIR}} | ||
DOC_DB_USER_NAME: ${{secrets.DOC_DB_USER_NAME}} | ||
DOC_DB_PASSWORD: ${{secrets.DOC_DB_PASSWORD}} | ||
DOC_DB_USER: ${{secrets.DOC_DB_USER}} | ||
DOC_DB_HOST: ${{secrets.DOC_DB_HOST}} | ||
DOC_DB_LOCAL_PORT: 27019 | ||
DOC_DB_REMOTE_PORT: 27017 | ||
DOC_DB_PRIV_KEY_FILE: ~/certs/docdb-sshtunnel.pem | ||
DOC_DB_LOG_PATH: "${{github.workspace}}/build/odbc/logs" | ||
DOC_DB_LOG_LEVEL: "debug" | ||
JDBC_DRIVER_VERSION: "1.2.1" | ||
JAVA_HOME: "/usr/lib/jvm/java-17-amazon-corretto/" | ||
|
||
jobs: | ||
build-linux64: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get Java distribution | ||
run: | | ||
sudo apt-get -y install software-properties-common | ||
wget -O- https://apt.corretto.aws/corretto.key | sudo apt-key add - | ||
sudo apt-add-repository 'deb https://apt.corretto.aws stable main' | ||
sudo apt-get update | ||
sudo apt-get install -y java-17-amazon-corretto-jdk | ||
- name: Get latest version of CMake | ||
uses: lukka/get-cmake@latest | ||
|
||
- name: run-cppcheck | ||
run: | | ||
sudo apt install cppcheck | ||
sh run_cppcheck.sh | ||
- name: upload-cppcheck-results | ||
if: failure() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cppcheck-results | ||
path: cppcheck-results.log | ||
|
||
- name: Extract key-pair into file | ||
run: | | ||
mkdir ~/certs | ||
echo "${{env.DOC_DB_KEYPAIR}}" > ${{env.DOC_DB_PRIV_KEY_FILE}} | ||
chmod 400 ${{env.DOC_DB_PRIV_KEY_FILE}} | ||
- name: get-dependencies | ||
if: success() | ||
run: | | ||
sudo apt update | ||
sudo apt install libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev linux-headers-$(uname -r) gcc gcc-multilib g++ g++-multilib linux-headers-$(uname -r) build-essential valgrind libboost-all-dev libbson-dev libsasl2-dev lcov | ||
- name: Cache DocumentDB JDBC JAR | ||
id: cache-documentdb-jdbc-jar | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
cache/jar | ||
key: cache-documentdb-jdbc-jar-${{env.JDBC_DRIVER_VERSION}} | ||
|
||
- name: Download DocumentDB JDBC JAR | ||
if: steps.cache-documentdb-jdbc-jar.outputs.cache-hit != 'true' | ||
run: | | ||
mkdir -p cache/jar | ||
cd cache/jar | ||
wget https://github.com/aws/amazon-documentdb-jdbc-driver/releases/download/v${{env.JDBC_DRIVER_VERSION}}/documentdb-jdbc-${{env.JDBC_DRIVER_VERSION}}-all.jar | ||
- name: Install DocumentDB JDBC JAR | ||
run: | | ||
mkdir -p ${{env.ODBC_BIN_PATH}}/libs | ||
cp cache/jar/documentdb-jdbc-${{env.JDBC_DRIVER_VERSION}}-all.jar ${{env.ODBC_BIN_PATH}}/libs | ||
- name: build-and-install-mongocxx | ||
run: | | ||
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.21.1/mongo-c-driver-1.21.1.tar.gz | ||
tar xzf mongo-c-driver-1.21.1.tar.gz | ||
cd mongo-c-driver-1.21.1 | ||
mkdir -p cmake-build | ||
cd cmake-build | ||
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .. | ||
sudo make install | ||
cd ../.. | ||
git clone https://github.com/mongodb/mongo-cxx-driver.git --branch releases/stable --depth 1 | ||
cd mongo-cxx-driver/build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DBSONCXX_POLY_USE_MNMLSTC=1 -DCMAKE_INSTALL_PREFIX=/usr/local | ||
sudo make install | ||
- name: install-mongocxx | ||
run: | | ||
cd mongo-c-driver-1.21.1/cmake-build | ||
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF .. | ||
sudo make | ||
sudo make install | ||
cd ../../ | ||
cd mongo-cxx-driver/build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DBSONCXX_POLY_USE_MNMLSTC=1 -DCMAKE_INSTALL_PREFIX=/usr/local | ||
sudo make | ||
sudo make install | ||
# TODO enable clang-tidy-check | ||
# https://bitquill.atlassian.net/browse/AD-726 | ||
|
||
# generate compile_commands.json file for clang-tidy-check, requires mongocxx and boost dependencies | ||
# - name: generate-compile-commands-file | ||
# run: | | ||
# cmake "${{github.workspace}}/src" -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DCMAKE_BUILD_TYPE=Release -DCODE_COVERAGE="OFF" -DBUILD_SHARED_LIBS="OFF" -DWITH_TESTS="ON" -DWITH_CORE="OFF" -DWITH_ODBC="ON" | ||
|
||
# - name: clang-tidy-check | ||
# uses: ZedThree/[email protected] | ||
# id: review | ||
# with: | ||
# If there are any comments, fail the check | ||
# - if: steps.review.outputs.total_comments > 0 | ||
# run: exit 1 | ||
|
||
- name: configure-and-build-driver | ||
run: | | ||
./build_linux_release64_deb.sh | ||
- name: register-odbc-driver | ||
run: | | ||
chmod +r -R ${{env.ODBC_LIB_PATH}} | ||
chmod +x scripts/register_driver_unix.sh | ||
sudo bash scripts/register_driver_unix.sh | ||
- name: set-up-local-mongodb | ||
run: | | ||
docker run --name mongo -e MONGO_INITDB_ROOT_USERNAME=${{env.DOC_DB_USER_NAME}} -e MONGO_INITDB_ROOT_PASSWORD=${{env.DOC_DB_PASSWORD}} -d -p 27017:27017 mongo:latest | ||
chmod +x ./src/odbc-test/scripts/import_test_data.sh | ||
./src/odbc-test/scripts/import_test_data.sh | ||
- name: run-tests | ||
run: | | ||
mkdir -p "${{env.DOC_DB_LOG_PATH}}" | ||
ssh -f -N -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}} | ||
./build/odbc/bin/ignite-odbc-tests --catch_system_errors=false | ||
- name: upload-test-report | ||
if: always() | ||
uses: EnricoMi/publish-unit-test-result-action/[email protected] | ||
with: | ||
check_name: "Ubuntu 20.04 Build Unit Test Results Check" | ||
comment_title: "Ubuntu 20.04 Build Unit Test Results" | ||
files: ./odbc_test_result.xml | ||
|
||
build-linux-docker-image: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: build-image | ||
run: | | ||
cd docker/linux-environment | ||
docker build -t documentdb-dev-linux . | ||
# TODO Linux build enhacements | ||
#https://bitquill.atlassian.net/browse/AD-688 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,11 +24,14 @@ env: | |
DOC_DB_LOCAL_PORT: 27019 | ||
DOC_DB_REMOTE_PORT: 27017 | ||
DOC_DB_PRIV_KEY_FILE: ~/certs/docdb-sshtunnel.pem | ||
JDBC_DRIVER_VERSION: "1.1.1" | ||
DOC_DB_ODBC_INTEGRATION_TEST: 1 | ||
DOC_DB_LOG_PATH: "${{github.workspace}}/build/odbc/logs" | ||
DOC_DB_LOG_LEVEL: "debug" | ||
JDBC_DRIVER_VERSION: "1.2.1" | ||
|
||
jobs: | ||
build-mac: | ||
runs-on: macos-latest | ||
runs-on: macos-11 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get Java distribution | ||
|
@@ -37,16 +40,16 @@ jobs: | |
distribution: 'temurin' | ||
java-version: '17' | ||
architecture: x64 | ||
# - name: run-cppcheck | ||
# run: | | ||
# brew install cppcheck | ||
# sh run_cppcheck.sh | ||
# - name: upload-cppcheck-results | ||
# if: failure() | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: cppcheck-results | ||
# path: cppcheck-results.log | ||
- name: run-cppcheck | ||
run: | | ||
brew install cppcheck | ||
sh run_cppcheck.sh | ||
- name: upload-cppcheck-results | ||
if: failure() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: cppcheck-results | ||
path: cppcheck-results.log | ||
- name: Extract key-pair into file | ||
run: | | ||
mkdir ~/certs | ||
|
@@ -55,11 +58,33 @@ jobs: | |
- name: get-dependencies | ||
run: | | ||
brew tap homebrew/services | ||
brew install unixodbc | ||
brew install cmake | ||
brew install openssl | ||
brew install boost | ||
brew install mongo-cxx-driver | ||
- name: Cache DocumentDB JDBC JAR | ||
id: cache-documentdb-jdbc-jar | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
cache/jar | ||
key: cache-documentdb-jdbc-jar-${{env.JDBC_DRIVER_VERSION}} | ||
|
||
- name: Download DocumentDB JDBC JAR | ||
if: steps.cache-documentdb-jdbc-jar.outputs.cache-hit != 'true' | ||
run: | | ||
mkdir -p cache/jar | ||
cd cache/jar | ||
wget https://github.com/aws/amazon-documentdb-jdbc-driver/releases/download/v${{env.JDBC_DRIVER_VERSION}}/documentdb-jdbc-${{env.JDBC_DRIVER_VERSION}}-all.jar | ||
- name: Install DocumentDB JDBC JAR | ||
run: | | ||
mkdir -p ${{env.ODBC_BIN_PATH}}/libs | ||
cp cache/jar/documentdb-jdbc-${{env.JDBC_DRIVER_VERSION}}-all.jar ${{env.ODBC_BIN_PATH}}/libs | ||
- name: configure-and-build-driver | ||
run: | | ||
./build_mac_release64.sh | ||
|
@@ -73,18 +98,28 @@ jobs: | |
# mkdir ${{ github.workspace }}/odbc-logs | ||
- name: register-odbc-driver | ||
run: | | ||
chmod +x scripts/register_driver_macos.sh | ||
./scripts/register_driver_macos.sh | ||
chmod +x scripts/register_driver_unix.sh | ||
./scripts/register_driver_unix.sh | ||
- name: Setup MongoDB | ||
run: | | ||
chmod +x ./src/odbc-test/scripts/reinstall_mongodb_mac.sh | ||
./src/odbc-test/scripts/reinstall_mongodb_mac.sh | ||
- name: Import test data | ||
run: | | ||
chmod +x ./src/odbc-test/scripts/import_test_data.sh | ||
./src/odbc-test/scripts/import_test_data.sh | ||
- name: run-tests | ||
run: | | ||
mkdir -p "${{env.DOC_DB_LOG_PATH}}" | ||
ssh -f -N -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${{env.DOC_DB_PRIV_KEY_FILE}} -L${{env.DOC_DB_LOCAL_PORT}}:${{secrets.DOC_DB_HOST}}:${{env.DOC_DB_REMOTE_PORT}} ${{secrets.DOC_DB_USER}} | ||
./build/odbc/bin/ignite-odbc-tests | ||
# - name: upload-test-report | ||
# if: failure() | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: test-result-macos | ||
# path: ${{ github.workspace }}/report.xml | ||
./build/odbc/bin/ignite-odbc-tests --catch_system_errors=false | ||
- name: upload-test-report | ||
if: always() | ||
uses: EnricoMi/publish-unit-test-result-action/[email protected] | ||
with: | ||
check_name: "MacOS Big Sur 11 Build Unit Test Results Check" | ||
comment_title: "MacOS Big Sur 11 Build Unit Test Results" | ||
files: ./odbc_test_result.xml | ||
# - name: print-memory-leak-logs | ||
# if: always() | ||
# run: | | ||
|
Oops, something went wrong.