Skip to content

Commit

Permalink
Test centos7_21
Browse files Browse the repository at this point in the history
  • Loading branch information
ARnDOSrte committed Sep 28, 2023
1 parent 7318ec8 commit d07ff42
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 31 deletions.
57 changes: 26 additions & 31 deletions .github/workflows/ci.yml → .github/workflows/ci_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
with:
cmake-version: '3.22.x'

- name: Checkout sources
uses: actions/checkout@v1

- name: Install boost
run: |
source /opt/rh/devtoolset-9/enable
Expand All @@ -32,35 +35,27 @@ jobs:
cd boost_1_73_0
./bootstrap.sh --prefix=/usr/local
./b2 install --without-python -j 5
- name: Checkout sources
uses: actions/checkout@v1

cd ..
- name: Configure 3rd parties
run: |
source /opt/rh/devtoolset-9/enable
mkdir -p $GITHUB_WORKSPACE/metrix-simulator/build-linux/external
cd $GITHUB_WORKSPACE/metrix-simulator/build-linux/external
cmake $GITHUB_WORKSPACE/metrix-simulator/external
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 5
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-linux/external --parallel 2
- name: Configure CMake
run: |
source /opt/rh/devtoolset-9/enable
mkdir -p $GITHUB_WORKSPACE/metrix-simulator/build-linux
cd $GITHUB_WORKSPACE/metrix-simulator/build-linux
cmake $GITHUB_WORKSPACE/metrix-simulator -Wno-dev
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-linux/install
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 5
run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-linux --target install --parallel 2

- name: Tests
run: cd $GITHUB_WORKSPACE/metrix-simulator/build-linux && ctest -j8 --output-on-failure
run: cd $GITHUB_WORKSPACE/metrix-simulator/build-linux && ctest -j2 --output-on-failure

qa:
name: QA - CI
Expand Down Expand Up @@ -102,14 +97,19 @@ jobs:
env:
SONAR_SCANNER_VERSION: 3.3.0.1492

- name: Install Boost
run: |
sudo apt-get update -y
sudo apt-get install -y libboost-all-dev
- 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
Expand All @@ -122,17 +122,12 @@ jobs:
- name: Configure CMake
run: |
source /opt/rh/devtoolset-9/enable
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build
-DCMAKE_BUILD_TYPE=Debug
-DCODE_COVERAGE=TRUE
-DMETRIX_RUN_ALL_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=TRUE -DMETRIX_RUN_ALL_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install
- name: Build
run: >
${{ runner.workspace }}/build-wrapper-linux-x86/build-wrapper-linux-x86-64
--out-dir $GITHUB_WORKSPACE/metrix-simulator/build/output
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --parallel 2 --target install
run: |
source /opt/rh/devtoolset-9/enable
${{ runner.workspace }}/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir $GITHUB_WORKSPACE/metrix-simulator/build/output cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --parallel 2 --target install
- name: Tests
run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j8 --output-on-failure
Expand All @@ -147,4 +142,4 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
${{ runner.workspace }}/sonar/bin/sonar-scanner
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.host.url=https://sonarcloud.io
115 changes: 115 additions & 0 deletions .github/workflows/ci_ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: CI-cpp

on: [push]

defaults:
run:
shell: bash

jobs:
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Install Boost
run: |
sudo apt-get update -y
sudo apt-get install -y libboost-all-dev
- name: Checkout sources
uses: actions/checkout@v1

- name: Configure 3rd parties
run: >
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: >
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build-linux
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-linux/install
- 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 -j8 --output-on-failure

qa:
name: QA - CI
runs-on: ubuntu-latest
steps:
- name: Install Java 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Install gcovr
run: |
sudo apt-get update -y
sudo apt-get install -y gcovr
- name: Install Sonar wrapper
working-directory: ${{ runner.workspace }}
run: |
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
- name: Install Sonar scanner
working-directory: ${{ runner.workspace }}
run: |
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
unzip sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
ln -s sonar-scanner-${SONAR_SCANNER_VERSION} sonar
rm sonar-scanner-cli-${SONAR_SCANNER_VERSION}.zip
env:
SONAR_SCANNER_VERSION: 3.3.0.1492

- name: Install Boost
run: |
sudo apt-get update -y
sudo apt-get install -y libboost-all-dev
- name: Checkout sources
uses: actions/checkout@v1

- name: Configure 3rd parties
run: >
cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build/external
- name: Build 3rd parties
run: >
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2
- name: Configure CMake
run: >
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build
-DCMAKE_BUILD_TYPE=Debug
-DCODE_COVERAGE=TRUE
-DMETRIX_RUN_ALL_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install
- name: Build
run: >
${{ runner.workspace }}/build-wrapper-linux-x86/build-wrapper-linux-x86-64
--out-dir $GITHUB_WORKSPACE/metrix-simulator/build/output
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --parallel 2 --target install
- name: Tests
run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j8 --output-on-failure

- name: Code coverage
run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target code-coverage

- name: Sonarcloud
working-directory: ${{ runner.workspace }}/powsybl-metrix/metrix-simulator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
${{ runner.workspace }}/sonar/bin/sonar-scanner
-Dsonar.host.url=https://sonarcloud.io

0 comments on commit d07ff42

Please sign in to comment.