Fix centos repo link in CI again #250
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI-cpp-centos7 | |
on: | |
workflow_dispatch: {} | |
pull_request: | |
types: [opened, ready_for_review, reopened] | |
push: | |
paths: | |
- 'metrix-simulator/**' | |
- '.github/workflows/ci_centos7.yml' | |
release: | |
types: [published] | |
# Cancel previous workflows if they are the same workflow on same ref (branch/tags) | |
# with the same event (push/pull_request) even they are in progress. | |
# This setting will help reduce the number of duplicated workflows. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
jobs: | |
linux: | |
name: Tests C++ CentOS | |
runs-on: ubuntu-latest | |
container: 'centos:centos7' | |
steps: | |
- name: Update mirrors | |
run: | | |
sed -i 's:mirror.centos.org:archive.kernel.org/centos-vault: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 | |
- name: Update Dependencies | |
run: | | |
yum update -y | |
- name: Install Dependencies 1 | |
run: | | |
yum install -y epel-release | |
- name: Install Dependencies 2 | |
run: | | |
yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils | |
- name: Update mirrors again because why not | |
run: | | |
sed -i 's:mirror.centos.org:archive.kernel.org/centos-vault: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 | |
- name: Install Dependencies 3 | |
run: | | |
yum install -y devtoolset-9 | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: '3.22.x' | |
- name: Checkout sources | |
uses: actions/checkout@v1 | |
- name: Download Boost-release | |
uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1 | |
with: | |
repo: 'ARnDOSrte/Boost' | |
file: 'boost_1_73_0.zip' | |
target: 'boost_1_73_0.zip' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Unzip Boost | |
run: unzip boost_1_73_0.zip | |
- name: Configure 3rd parties | |
run: | | |
source /opt/rh/devtoolset-9/enable | |
cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-centos7/external | |
- name: Build 3rd parties | |
run: | | |
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-centos7/external --parallel 2 | |
- name: Configure CMake | |
run: | | |
source /opt/rh/devtoolset-9/enable | |
cmake -S $GITHUB_WORKSPACE/metrix-simulator -Wno-dev -DCMAKE_BUILD_TYPE=Release -DBoost_ROOT=$GITHUB_WORKSPACE/__w/Boost/Boost/boost_1_73_0/installBoost -DBoost_INCLUDE_DIR=$GITHUB_WORKSPACE/__w/Boost/Boost/boost_1_73_0/installBoost -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-centos7/install -B $GITHUB_WORKSPACE/metrix-simulator/build-centos7 | |
- name: Build | |
run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-centos7 --target install --parallel 2 | |
- name: Tests | |
run: cd $GITHUB_WORKSPACE/metrix-simulator/build-centos7 && ctest -j2 --output-on-failure |