Skip to content

Commit

Permalink
Test_1
Browse files Browse the repository at this point in the history
  • Loading branch information
ARnDOSrte committed Oct 5, 2023
1 parent 008c24e commit cc4f51c
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 65 deletions.
52 changes: 1 addition & 51 deletions .github/workflows/ci_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,54 +55,4 @@ jobs:
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
if: "contains(github.ref, 'tag')"
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
if: "contains(github.ref, 'tag')"
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
if: "contains(github.ref, 'tag')"
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: metrix-simulator.zip
path: ./

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TEST_TOKEN_RELEASE }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TEST_TOKEN_RELEASE }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: metrix-simulator.zip
asset_name: metrix-simulator.zip
asset_content_type: application/zip
# run: cd $GITHUB_WORKSPACE/metrix-simulator/build-linux && ctest -j2 --output-on-failure
90 changes: 76 additions & 14 deletions .github/workflows/qa_pr_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name: QA-PR-CPP
on:
pull_request:
types: [opened, synchronize, edited]
release:
types: [created, published, released]

jobs:
clang-tidy:
name: clang-tidy
runs-on: ubuntu-latest
container: 'centos:centos7'
steps:
- name: Install Boost
run: |
Expand All @@ -17,8 +18,8 @@ jobs:
- name: Install clang-tidy
run: |
sudo apt install -y clang-tidy-9
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-9 100
sudo apt install -y clang-tidy-14
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 100
- name: Checkout sources
uses: actions/checkout@v1
Expand Down Expand Up @@ -46,15 +47,16 @@ jobs:
qa:
name: QA - full
runs-on: ubuntu-latest
container: 'centos:centos7'
steps:
- name: Install Java 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Install gcovr
run: sudo pip install gcovr
run: |
sudo apt-get update -y
sudo apt-get install -y gcovr
- name: Install Sonar wrapper
working-directory: ${{ runner.workspace }}
Expand Down Expand Up @@ -88,12 +90,21 @@ jobs:
run: >
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2
- name: Configure CMake
- name: Configure CMake (For Release)
if: github.event_name == 'release'
run: >
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build
-DCMAKE_BUILD_TYPE=Debug
-DCODE_COVERAGE=TRUE
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install
- name: Configure CMake (For Pull Request)
if: github.event_name != 'release'
run: >
cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build
-DCMAKE_BUILD_TYPE=Debug
-DCODE_COVERAGE=FALSE
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install
- name: Build
run: >
Expand All @@ -102,16 +113,67 @@ jobs:
cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --parallel 2 --target install
- name: Tests
run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure
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
# - 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

- name: Prepare Metrix install
if: github.event_name == 'release'
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
if: github.event_name == 'release'
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
if: github.event_name == 'release'
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: metrix-simulator.zip
path: ./

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
${{ runner.workspace }}/sonar/bin/sonar-scanner
-Dsonar.host.url=https://sonarcloud.io
GITHUB_TOKEN: ${{ secrets.TEST_TOKEN_RELEASE }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TEST_TOKEN_RELEASE }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: metrix-simulator.zip
asset_name: metrix-simulator.zip
asset_content_type: application/zip

0 comments on commit cc4f51c

Please sign in to comment.