Skip to content

CI-cpp-centos7

CI-cpp-centos7 #15

Workflow file for this run

name: CI-cpp-centos7
on: [push]
defaults:
run:
shell: bash
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
container: 'centos:centos7'
steps:
- name: Install Dependancies
run: |
yum update -y
yum install -y epel-release
yum install -y git redhat-lsb-core make wget centos-release-scl scl-utils
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: Install boost
run: |
source /opt/rh/devtoolset-9/enable
wget https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
tar -xzvf ./boost_1_73_0.tar.gz
cd boost_1_73_0
./bootstrap.sh --prefix=/usr/local
./b2 install --without-python -j 5
cd ..
- name: Configure 3rd parties
run: |
source /opt/rh/devtoolset-9/enable
cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-linux/external
- name: Build 3rd parties
run: |
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-linux/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 -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-linux/install -B $GITHUB_WORKSPACE/metrix-simulator/build-linux
- name: Build
run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-linux --target install --parallel 2
# - name: Tests
# run: cd $GITHUB_WORKSPACE/metrix-simulator/build-linux && ctest -j2 --output-on-failure
- name: Prepare Metrix install
id: metrix-install
run: |
ARCHIVE_NAME="metrix-simulator.zip"
ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}"
zip $ARCHIVE_PATH /__w/powsybl-metrix/powsybl-metrix/metrix-simulator/build-linux/install/bin/metrix-simulator
echo "::set-output name=archive_name::$ARCHIVE_NAME"
echo "::set-output name=archive_path::$ARCHIVE_PATH"
- name: Upload OR-Tools install artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.metrix-install.outputs.archive_name }}
path: ${{ steps.metrix-install.outputs.archive_path }}
publish_asset:
name: Publish release assets
needs: linux
runs-on: ubuntu-latest
container: 'centos:centos7'
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Publish assets
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["*/*.zip"]'