Initial implementation to fix errors. #122
Workflow file for this run
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
name: OpenSearch ODBC Driver | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches-ignore: | |
- 'dependabot/**' | |
env: | |
CI_OUTPUT_PATH: "./ci-output" | |
ODBC_LIB_PATH: "./build/odbc/lib" | |
ODBC_BIN_PATH: "./build/odbc/bin" | |
ODBC_BUILD_PATH: "./build/odbc/cmake" | |
VCPKG_X64_INSTALL_PATH: ".\\src\\vcpkg_installed\\x64-windows" | |
VCPKG_X86_INSTALL_PATH: ".\\src\\vcpkg_installed\\x86-windows" | |
# Tests are disabled (commented out) in all jobs because they are fail and/or outdated | |
# Keeping them for the brighten future when we can re-activate them | |
jobs: | |
build-mac: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run cppcheck | |
run: | | |
brew install cppcheck | |
sh run_cppcheck.sh | |
- name: Upload cppcheck results | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cppcheck-results | |
path: cppcheck-results.log | |
- name: Get dependencies | |
run: | | |
brew install curl | |
brew install cmake | |
brew install libiodbc | |
- name: Get vcpkg config fingerprint | |
id: get-key | |
run: | | |
echo key=`md5 src/vcpkg.json | cut -d ' ' -f 4`-mac >> $GITHUB_OUTPUT | |
- name: Restore vcpkg cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: src/vcpkg_installed | |
key: ${{ steps.get-key.outputs.key }} | |
- name: Configure and build driver | |
run: | | |
./build_mac_release64.sh | |
- name: Save vcpkg cache | |
uses: actions/cache/save@v3 | |
with: | |
path: src/vcpkg_installed | |
key: ${{ steps.get-key.outputs.key }} | |
#- name: test | |
# run: | | |
# bash ./run_test_runner.sh | |
- name: Build installer | |
if: success() | |
run: | | |
cd cmake-build64 | |
cmake ../src | |
make | |
cpack . | |
cd .. | |
- name: Create-output | |
if: success() | |
run: | | |
mkdir build-output | |
mkdir test-output | |
mkdir installer | |
cp ./build/odbc/lib/*.dylib build-output/ | |
cp ./build/odbc/lib/*.a build-output/ | |
cp ./cmake-build64/*.pkg installer/ | |
# cp $(ls -d ./build/odbc/bin/* | grep -v "\.") build-output | |
# cp ./bin64/*.html test-output | |
# cp ./bin64/*.log test-output | |
- name: Upload build | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mac64-build | |
path: build-output | |
- name: Upload installer | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mac64-installer | |
path: installer | |
#- name: Upload test results | |
# if: always() | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: mac-test-results | |
# path: test-output | |
build-windows32: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get specific version CMake, v3.26.3 | |
uses: lukka/[email protected] | |
- name: Add msbuild to path | |
uses: microsoft/[email protected] | |
- name: Get vcpkg config fingerprint | |
id: get-key | |
run: | | |
"key=" + (Get-FileHash -Algorithm MD5 .\src\vcpkg.json).Hash + "-w32" >> $Env:GITHUB_OUTPUT | |
- name: Restore vcpkg cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: src/vcpkg_installed | |
key: ${{ steps.get-key.outputs.key }} | |
- name: Configure and build driver | |
run: | | |
.\build_win_release32.ps1 | |
- name: Save vcpkg cache | |
if: steps.cache-restore.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v3 | |
with: | |
path: src/vcpkg_installed | |
key: ${{ steps.get-key.outputs.key }} | |
- name: Build installer | |
if: success() | |
run: | | |
.\scripts\build_installer.ps1 Release Win32 .\src $Env:ODBC_BUILD_PATH $Env:VCPKG_X86_INSTALL_PATH | |
#- name: test | |
# run: | | |
# cp .\\libraries\\VisualLeakDetector\\bin32\\*.* .\\bin32\\Release | |
# cp .\\libraries\\VisualLeakDetector\\lib32\\*.lib .\\lib32\\Release | |
# .\run_test_runner.bat | |
- name: Prepare output | |
if: always() | |
run: | | |
.\scripts\prepare_ci_output.ps1 $Env:ODBC_BIN_PATH $Env:ODBC_LIB_PATH $Env:ODBC_BUILD_PATH | |
- name: Upload build | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows32-build | |
path: ci-output/build | |
- name: Upload installer | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows32-installer | |
path: ci-output/installer | |
#- name: Upload test results | |
# if: always() | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: windows-test-results | |
# path: $CI_OUTPUT_PATH/test | |
build-windows64: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get specific version CMake, v3.26.3 | |
uses: lukka/[email protected] | |
- name: Add msbuild to path | |
uses: microsoft/[email protected] | |
- name: Get vcpkg config fingerprint | |
id: get-key | |
run: | | |
"key=" + (Get-FileHash -Algorithm MD5 .\src\vcpkg.json).Hash + "-w64" >> $Env:GITHUB_OUTPUT | |
- name: Restore vcpkg cache | |
id: cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: src/vcpkg_installed | |
key: ${{ steps.get-key.outputs.key }} | |
- name: Configure and build driver | |
run: | | |
.\build_win_release64.ps1 | |
- name: Save vcpkg cache | |
if: steps.cache-restore.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v3 | |
with: | |
path: src/vcpkg_installed | |
key: ${{ steps.get-key.outputs.key }} | |
- name: Build installer | |
if: success() | |
run: | | |
.\scripts\build_installer.ps1 Release x64 .\src $Env:ODBC_BUILD_PATH $Env:VCPKG_X64_INSTALL_PATH | |
#- name: test | |
# run: | | |
# cp .\\libraries\\VisualLeakDetector\\bin64\\*.* .\\bin64\\Release | |
# cp .\\libraries\\VisualLeakDetector\\lib64\\*.lib .\\lib64\\Release | |
# .\run_test_runner.bat | |
- name: Prepare output | |
if: always() | |
run: | | |
.\scripts\prepare_ci_output.ps1 $Env:ODBC_BIN_PATH $Env:ODBC_LIB_PATH $Env:ODBC_BUILD_PATH | |
- name: Upload build | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows64-build | |
path: ci-output/build | |
- name: Upload installer | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows64-installer | |
path: ci-output/installer | |
#- name: Upload test results | |
# if: always() | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: windows-test-results | |
# path: ci-output/test-output |