From 95be592270f8db5c62ec82f41356dc8f3e5dc48a Mon Sep 17 00:00:00 2001 From: cyjseagull Date: Wed, 23 Oct 2024 12:41:36 +0800 Subject: [PATCH] fix centos ci --- .github/workflows/workflow.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 644338f..d231727 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -14,6 +14,7 @@ on: types: [published, created, edited] env: CCACHE_DIR: ${{ github.workspace }}/ccache + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true jobs: build_with_clang: @@ -128,21 +129,17 @@ jobs: container: image: docker.io/centos:7 volumes: - - /github/home/vcpkg:/github/home/vcpkg + - /usr/local/share/vcpkg:/usr/local/share/vcpkg steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 5 - - name: Prepare vcpkg - if: runner.os != 'Windows' - uses: friendlyanon/setup-vcpkg@v1 - with: { committish: 51b14cd4e1230dd51c11ffeff6f7d53c61cc5297 } - uses: actions/cache@v2 id: cache with: path: | - /home/runner/vcpkg - /github/home/vcpkg + /usr/local/share/vcpkg/buildtrees + /usr/local/share/vcpkg/packages ccache key: vcpkg-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} restore-keys: | @@ -151,13 +148,23 @@ jobs: vcpkg-centos-v1-notest-${{ runner.temp }}- - name: install CentOS dependencies run: | - yum install -y epel-release centos-release-scl - yum install -y git make gcc gcc-c++ glibc-static glibc-devel cmake3 ccache devtoolset-7 openssl libzstd-devel zlib-devel flex bison python-devel python3-devel && source /opt/rh/devtoolset-7/enable + rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl-rh/2/3.el7.centos/noarch/centos-release-scl-rh-2-3.el7.centos.noarch.rpm + rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl/2/3.el7.centos/noarch/centos-release-scl-2-3.el7.centos.noarch.rpm + sed -i s/mirror.centos.org/mirrors.aliyun.com/g /etc/yum.repos.d/*.repo + sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo + sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo + cat /etc/yum.repos.d/*.repo + yum clean all + yum makecache + yum update -y + yum install -y epel-release centos-release-scl centos-release-scl-rh + yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm + yum install -y git make gcc gcc-c++ glibc-static glibc-devel cmake3 ccache devtoolset-11 openssl libzstd-devel zlib-devel flex bison python-devel python3-devel && source /opt/rh/devtoolset-11/enable - name: configure and compile run: | - source /opt/rh/devtoolset-7/enable + source /opt/rh/devtoolset-11/enable # mkdir -p build && cd build - cmake3 -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DTESTS=ON . + cmake3 -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake -DTESTS=ON . make -j2 CTEST_OUTPUT_ON_FAILURE=TRUE make test ARGS="--output-on-failure"