From 321e13b11fc33129debbbd5c5da98f2e44fbabc0 Mon Sep 17 00:00:00 2001 From: amyangfei Date: Fri, 30 Aug 2024 16:00:21 +0800 Subject: [PATCH] ci: add basic build workflow (#1) --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++++++++++++++ .gitignore | 1 + CMakeLists.txt | 6 ++--- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..a1dff94c8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: build CI + +on: + push: + branches: [ "8.0" ] + pull_request: + branches: [ "8.0" ] + +jobs: + build: + + runs-on: ubuntu-latest + env: + ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16 + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true + strategy: + matrix: + include: + - image: centos:7 + name: prepare + run: | + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/*.repo + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/*.repo + sed -i 's|baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/*.repo + yum install -y kernel-devel kernel gcc make elfutils-libelf-devel + container: + image: ${{ matrix.image }} + options: --security-opt seccomp=unconfined + + steps: + - run: cat /etc/os-release + - name: prepare + run: ${{ matrix.run }} + - uses: actions/checkout@v3 + - name: prepare necessary dependences + run: | + yum install -y git ncurses-devel bison libaio-devel openssl openssl-devel cyrus-sasl-devel openldap-devel libtirpc-devel which expect + yum install -y centos-release-scl + sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-SCLo*.repo + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo + sed -i 's|# baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-SCLo-scl.repo + yum install -y epel-release && yum install -y cmake3 gtest + yum install -y devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-binutils + source /opt/rh/devtoolset-10/enable + gcc --version + mkdir /txsql_extra && curl -o /txsql_extra/boost_1_70_0.tar.gz https://archives.boost.io/release/1.70.0/source/boost_1_70_0.tar.gz + tar xzf /txsql_extra/boost_1_70_0.tar.gz -C /txsql_extra + - name: build test + run: | + ./build.sh -b /txsql_extra/boost_1_70_0 -D 1 diff --git a/.gitignore b/.gitignore index 96f7d835d..1380c56f7 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ source_downloads #compile temporary dirs and files bld mysql_install +bld-debug #will automatic unzip from depend/boost_1_70_0.tgz depend/boost_1_70_0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 685ca1b5a..88855bc0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,13 +250,13 @@ IF(CMAKE_HOST_UNIX AND NOT FORCE_UNSUPPORTED_COMPILER FIND_PROGRAM(ALTERNATIVE_GCC gcc NO_DEFAULT_PATH - PATHS "/opt/rh/devtoolset-8/root/usr/bin") + PATHS "/opt/rh/devtoolset-10/root/usr/bin") FIND_PROGRAM(ALTERNATIVE_GPP g++ NO_DEFAULT_PATH - PATHS "/opt/rh/devtoolset-8/root/usr/bin") + PATHS "/opt/rh/devtoolset-10/root/usr/bin") FIND_PROGRAM(ALTERNATIVE_ENABLE enable NO_DEFAULT_PATH - PATHS "/opt/rh/devtoolset-8/") + PATHS "/opt/rh/devtoolset-10/") IF(ALTERNATIVE_GCC AND ALTERNATIVE_GPP) SET(CMAKE_C_COMPILER ${ALTERNATIVE_GCC}) SET(CMAKE_CXX_COMPILER ${ALTERNATIVE_GPP})