Skip to content

Merge branch 'cmake_and_windows_port5' of https://github.com/vaintrou… #59

Merge branch 'cmake_and_windows_port5' of https://github.com/vaintrou…

Merge branch 'cmake_and_windows_port5' of https://github.com/vaintrou… #59

Workflow file for this run

name: CMake
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: [windows-latest,ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
name: Build/${{ matrix.os }}
env:
CMAKE_VCPKG_PARAMS: ${{ contains(matrix.os, 'windows') && '-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-release' || ' ' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: install client drivers (macOS)
if: contains(matrix.os, 'macos')
run : |
HOMEBREW_NO_AUTO_UPDATE=1 brew install mysql-client libpq
brew link --force mysql-client
# On Windows, use vcpkg to build, as pgsql driver on build box is bad (crashes during tests)
- name: vcpkg_cache(Windows)
uses: actions/cache@v3
if: contains(matrix.os, 'windows')
id: vcpkg_cache
with:
path: ~\AppData\Local\vcpkg
key: ${{ runner.os }}-vcpkg-libpq-zlib
- name: vcpkg install(Windows)
if: contains(matrix.os, 'windows')
run: vcpkg install libpq zlib --triplet=x64-windows-release
- name: configure
run: cmake . -DWITH_PGSQL=1 -DCMAKE_COMPILE_WARNING_AS_ERROR=1 ${{ env.CMAKE_VCPKG_PARAMS }}
- name: build package
run: cmake --build . --config Release --target package -j
- name: unit test(non-Windows)
if: matrix.os != 'windows-latest'
run: cmake --build . --config Release --target test -j
- name: upload package(Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-package
path: ./*.zip
- name: test_install
run: |
cmake --install . --config Release --prefix install_dir
- name: Archive build
uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.os }}
retention-days: 1
path: |
install_dir
test-oltp:
strategy:
matrix:
os: [windows-latest,ubuntu-latest, macos-latest]
db: [mariadb, mysql, postgres]
needs: build
runs-on: ${{ matrix.os }}
name: Test OLTP/ ${{ matrix.os }} / ${{matrix.db}}
env:
COMMON_SYSBENCH_PARAMS: ${{ matrix.db == 'postgres' && '--db-driver=pgsql --pgsql-password=sbtest' || '--mysql-user=root --mysql-socket=/tmp/mysql.sock'}} --time=30 --table-size=100000 --threads=1 --report-interval=1 --histogram
steps:
- name: Download build
uses: actions/download-artifact@v3
with:
name: build-${{ matrix.os }}
- name: chmod +x bin/sysbench
shell: bash
if: ${{ !contains(matrix.os, 'windows') }}
run: |
ls -l bin
chmod +x bin/sysbench
- name: install client drivers (macOS)
if: contains(matrix.os, 'macos')
run : |
HOMEBREW_NO_AUTO_UPDATE=1 brew install mysql-client libpq
brew link --force mysql-client
- name: update environment (Windows)
if: contains(matrix.os, 'windows')
run: |
echo "$pwd\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
cat $env:GITHUB_PATH
- name: update environment (non-Windows)
if: ${{ !contains(matrix.os, 'windows') }}
run: |
echo "$PWD/bin" >> $GITHUB_PATH
cat $GITHUB_PATH
echo "LUA_PATH=$PWD/share/sysbench/?.lua" >> $GITHUB_ENV
- name: actions-setup-pgsql
if: matrix.db =='postgres'
uses: ikalnytskyi/action-setup-postgres@v4
with:
username: sbtest
password: sbtest
database: sbtest
- name: actions-setup-mysql
if: matrix.db != 'postgres'
uses: shogo82148/actions-setup-mysql@v1
env: # set temp directory, so that datadir ends up on fast disk
TMPDIR: ${{ runner.temp }}
TMP: ${{ runner.temp }}
TEMP: ${{ runner.temp }}
with:
distribution: ${{ matrix.db }}
my-cnf: |
${{ matrix.db == 'mysql' && 'innodb_redo_log_capacity' || 'innodb_log_file_size' }}=4G
innodb_buffer_pool_size=512MB
max_allowed_packet=16MB
skip-log-bin
loose-enable-named-pipe
socket=/tmp/mysql.sock
max_connections=1000
innodb_max_dirty_pages_pct_lwm=10
- name: create database sbtest
if: matrix.db != 'postgres'
run: |
mysql -uroot --host=127.0.0.1 --port=3306 -e "create database sbtest"
- name: sysbench oltp_update_index prepare
run: sysbench oltp_update_index ${{ env.COMMON_SYSBENCH_PARAMS }} prepare
- name: sysbench oltp_point_select run
run: sysbench oltp_point_select ${{ env.COMMON_SYSBENCH_PARAMS }} --threads=10 run
- name: sysbench oltp_update_index run
run: sysbench oltp_update_index ${{ env.COMMON_SYSBENCH_PARAMS }} --threads=1 run
- name: sysbench oltp_update_index run 40 threads
run: sysbench oltp_update_index ${{ env.COMMON_SYSBENCH_PARAMS }} --threads=40 run
- name: sysbench oltp_update_index cleanup
run: sysbench oltp_update_index ${{ env.COMMON_SYSBENCH_PARAMS }} cleanup
# The below fileio test help estimate whether DBMS has "relaxed" durability, in other words cheats on
#
# oltp_update_index test with 1 user can't have qps much higher than sequential rewrite test with fdatasync
# if it does, durability is mostly likely "relaxed"
- name: fileio seqrewr prepare
run: sysbench fileio --file-block-size=4096 --file-test-mode=seqrewr --file-num=1 prepare
- name: fileio seqrewr run fdatasync
if: ${{ !contains(matrix.os, 'macos') }}
run: sysbench fileio --file-block-size=4096 --file-test-mode=seqrewr --file-fsync-mode=fdatasync --file-fsync-all=on --file-num=1 --report-interval=1 --time=20 --histogram run
- name: fileio seqrewr run fsync
run: sysbench fileio --file-block-size=4096 --file-test-mode=seqrewr --file-fsync-mode=fsync --file-fsync-all=on --file-num=1 --report-interval=1 --time=20 --histogram run