Skip to content

Commit

Permalink
fix centos ci (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull authored Oct 23, 2024
1 parent 23272e0 commit 62d76ae
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand All @@ -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"
Expand Down

0 comments on commit 62d76ae

Please sign in to comment.