From e90daf720c99e900ab7c6d9e1c32f50d54ae9a5b Mon Sep 17 00:00:00 2001 From: Yura Sorokin Date: Wed, 6 Mar 2024 00:59:21 +0100 Subject: [PATCH] GitHub Workflows extended with running MTR Added a new step for installing 'mysql-client', 'mysql-server' and 'mysql-testsuite' packages. Added a new step for running 'binlog_streaming' MTR test suite. Added 'SimenB/github-actions-cpu-cores@v2' action to determine the optimal parallelism factor. --- .github/workflows/cmake.yml | 39 ++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 89bad0e..5d72517 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -52,14 +52,16 @@ jobs: build_type: "Debug", cc: "gcc-13", cxx: "g++-13", - label: "debug_gcc13" + label: "debug_gcc13", + run_mtr: true } - { name: "GCC 13 RelWithDebInfo", build_type: "RelWithDebInfo", cc: "gcc-13", cxx: "g++-13", - label: "relwithdebinfo_gcc13" + label: "relwithdebinfo_gcc13", + run_mtr: true } - { name: "Clang 17 Debug", @@ -79,6 +81,10 @@ jobs: } steps: + - name: Get number of CPU cores + uses: SimenB/github-actions-cpu-cores@v2 + id: cpu-cores + - name: Info CPU run: cat /proc/cpuinfo @@ -88,6 +94,15 @@ jobs: - name: Info df run: df -h + - name: Install MySQL client libraries + run: | + sudo apt-get install libmysqlclient-dev + + - name: Install MySQL server and MTR + if: matrix.config.run_mtr + run: | + sudo apt-get install mysql-client mysql-server mysql-testsuite apparmor-utils + - name: Install Clang dependencies on ubuntu if: startsWith(matrix.config.name, 'Clang') run: | @@ -95,6 +110,7 @@ jobs: echo deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main | sudo tee /etc/apt/sources.list.d/llvm.list sudo apt-get update sudo apt-get install clang-17 lld-17 clang-tidy-17 libc++-17-dev libc++1-17 libc++abi-17-dev libc++abi1-17 + - name: Install GCC dependencies on ubuntu if: startsWith(matrix.config.name, 'GCC') run: | @@ -154,11 +170,24 @@ jobs: run: clang-tidy-17 --version - name: Clang Tidy - if: startsWith(matrix.config.name, 'Clang') + if: startsWith(matrix.config.name, 'QWEClang') # Run Clang Tidy - run: run-clang-tidy-17 -header-filter=.* -j=2 -use-color -p=${{github.workspace}}/../build-${{matrix.config.label}} + run: run-clang-tidy-17 -header-filter=.* -j=${{steps.cpu-cores.outputs.count}} -use-color -p=${{github.workspace}}/../build-${{matrix.config.label}} - - name: Test + - name: MTR tests + if: matrix.config.run_mtr + working-directory: /usr/lib/mysql-test + run: | + # Switching MySQL Server Apparmor profile to "complain" as we are creading a custom data directory + sudo aa-complain /usr/sbin/mysqld + # Linking the "binlog_streaming" from the source tree into the MTR suits directory on the system + sudo ln -s ${{github.workspace}}/mtr/binlog_streaming /usr/lib/mysql-test/suite/binlog_streaming + BINSRV=${{github.workspace}}/../build-${{matrix.config.label}}/binlog_server ./mtr \ + --client-bindir=/usr/lib/mysql-test/bin --vardir=${{github.workspace}}/../mtrvardir \ + --force --max-test-fail=0 --retry=0 --nounit-tests --big-test --repeat=2 --parallel=${{steps.cpu-cores.outputs.count}} \ + --suite=binlog_streaming + + - name: CTest working-directory: ${{github.workspace}}/../build-${{matrix.config.label}} # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail