From d612eff66baa9f96ebef17b26bd23d3b94cfbd21 Mon Sep 17 00:00:00 2001 From: zhangbaowen Date: Wed, 10 Jul 2024 11:50:41 +0800 Subject: [PATCH] test try_build.yml --- .github/workflows/try_build.yml | 90 +++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/try_build.yml diff --git a/.github/workflows/try_build.yml b/.github/workflows/try_build.yml new file mode 100644 index 00000000000..765a25fd045 --- /dev/null +++ b/.github/workflows/try_build.yml @@ -0,0 +1,90 @@ +name: Try build from source +on: + workflow_dispatch: + push: + pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] + branches: + - test-ci + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - name: Build on ubuntu:24.04 + image: ubuntu:24.04 + distribution: ubuntu + - name: Build on ubuntu:22.04 + image: ubuntu:22.04 + distribution: ubuntu + - name: Build on ubuntu:20.04 + image: ubuntu:20.04 + distribution: ubuntu + - name: Build on debian:12 + image: debian:12 + distribution: debian + - name: Build on debian:11 + image: debian:11 + distribution: debian + - name: Build on oraclelinux:9 + image: oraclelinux:9 + distribution: oraclelinux + - name: Build on fedora:39 + image: fedora:39 + distribution: fedora + - name: Build on fedora:38 + image: fedora:38 + distribution: fedora + - name: Build on openeuler:24.03 + image: openeuler/openeuler:24.03 + distribution: openeuler + - name: Build on openeuler:22.03 + image: openeuler/openeuler:22.03 + distribution: openeuler + + name: "${{ matrix.name }}" + runs-on: ubuntu-latest + container: "${{ matrix.image }}" + + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: | + set -eux + + if [ "${{ matrix.distribution }}" = "openeuler" ]; then + yum group install -y "Development Tools" + yum install -y apr-devel bison bzip2-devel cmake3 flex krb5-devel libcurl-devel libevent-devel libkadm5 libxml2-devel libzstd-devel openssl-devel perl-ExtUtils-Embed perl-ExtUtils-MakeMaker perl-File-Compare python3 python3-devel python3-pip python3-psutil python3-psutil python3-psycopg2 python3-pyyaml readline-devel rsync xerces-c-devel zlib-devel + fi + + if [ "${{ matrix.distribution }}" = "oraclelinux" ]; then + yum group install -y "Development Tools" + yum install -y epel-release + yum install -y apr-devel bison bzip2-devel cmake3 flex krb5-devel libcurl-devel libevent-devel libkadm5 libxml2-devel libzstd-devel openssl-devel perl-ExtUtils-Embed perl-ExtUtils-MakeMaker perl-File-Compare perl-File-Copy perl-FindBin perl-Opcode python3 python3-devel python3-pip python3-psutil python3-psutil python3-psycopg2 python3-pyyaml readline-devel rsync xerces-c-devel zlib-devel + fi + + if [ "${{ matrix.distribution }}" = "fedora" ]; then + yum group install -y "Development Tools" + yum install -y apr-devel bison bzip2-devel cmake3 flex g++ gcc krb5-devel libcurl-devel libevent-devel libkadm5 libxml2-devel libzstd-devel openssl-devel perl-ExtUtils-Embed perl-ExtUtils-MakeMaker perl-File-Compare perl-File-Copy perl-FindBin perl-Opcode python3 python3-devel python3-pip python3-psutil python3-psutil python3-psycopg2 python3-pyyaml readline-devel rsync xerces-c-devel zlib-devel + fi + + if [ "${{ matrix.distribution }}" = "ubuntu" ] || [ "${{ matrix.distribution }}" = "debian" ]; then + TZ=Asia/Shanghai + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + export DEBIAN_FRONTEND=noninteractive + + apt-get update + apt-get install -y -qq bison ccache cmake curl flex g++ gcc git-core inetutils-ping krb5-admin-server krb5-kdc libapr1-dev libbz2-dev libcurl4-gnutls-dev libevent-dev libkrb5-dev libpam-dev libperl-dev libreadline-dev libssl-dev libxerces-c-dev libxml2-dev libyaml-dev libzstd-dev locales net-tools ninja-build openssh-client openssh-server openssl pkg-config python3-dev python3-pip python3-psutil python3-pygresql python3-yaml zlib1g-dev + fi + - name: Build from source + run: | + set -eux + + CPUS=$(grep -c ^processor /proc/cpuinfo) + + ./configure --with-perl --with-python --with-libxml --with-gssapi --prefix=`pwd`/inst + + make -j${CPUS} + make -j${CPUS} install \ No newline at end of file