From 3adc7df667fabe200be9d46e4b457ee55c533092 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Tue, 15 Oct 2024 19:49:32 +0200 Subject: [PATCH 01/16] try rework github workflows Signed-off-by: Damien Jeandemange --- .../ci_centos7.yml | 0 .../{workflows => old_workflows}/ci_ol8.yml | 0 .../ci_ubuntu.yml | 2 +- .../{workflows => old_workflows}/maven.yml | 0 .../qa_pr_cpp_centos7.yml | 0 .../qa_pr_cpp_ol8.yml | 0 .../qa_pr_cpp_ubuntu.yml | 0 .github/workflows/dev-ci.yml | 270 ++++++++++++++++++ 8 files changed, 271 insertions(+), 1 deletion(-) rename .github/{workflows => old_workflows}/ci_centos7.yml (100%) rename .github/{workflows => old_workflows}/ci_ol8.yml (100%) rename .github/{workflows => old_workflows}/ci_ubuntu.yml (98%) rename .github/{workflows => old_workflows}/maven.yml (100%) rename .github/{workflows => old_workflows}/qa_pr_cpp_centos7.yml (100%) rename .github/{workflows => old_workflows}/qa_pr_cpp_ol8.yml (100%) rename .github/{workflows => old_workflows}/qa_pr_cpp_ubuntu.yml (100%) create mode 100644 .github/workflows/dev-ci.yml diff --git a/.github/workflows/ci_centos7.yml b/.github/old_workflows/ci_centos7.yml similarity index 100% rename from .github/workflows/ci_centos7.yml rename to .github/old_workflows/ci_centos7.yml diff --git a/.github/workflows/ci_ol8.yml b/.github/old_workflows/ci_ol8.yml similarity index 100% rename from .github/workflows/ci_ol8.yml rename to .github/old_workflows/ci_ol8.yml diff --git a/.github/workflows/ci_ubuntu.yml b/.github/old_workflows/ci_ubuntu.yml similarity index 98% rename from .github/workflows/ci_ubuntu.yml rename to .github/old_workflows/ci_ubuntu.yml index e4e2a3aa..e0573af4 100644 --- a/.github/workflows/ci_ubuntu.yml +++ b/.github/old_workflows/ci_ubuntu.yml @@ -129,4 +129,4 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: > ${{ runner.workspace }}/sonar/bin/sonar-scanner - -Dsonar.host.url=https://sonarcloud.io \ No newline at end of file + -Dsonar.host.url=https://sonarcloud.io diff --git a/.github/workflows/maven.yml b/.github/old_workflows/maven.yml similarity index 100% rename from .github/workflows/maven.yml rename to .github/old_workflows/maven.yml diff --git a/.github/workflows/qa_pr_cpp_centos7.yml b/.github/old_workflows/qa_pr_cpp_centos7.yml similarity index 100% rename from .github/workflows/qa_pr_cpp_centos7.yml rename to .github/old_workflows/qa_pr_cpp_centos7.yml diff --git a/.github/workflows/qa_pr_cpp_ol8.yml b/.github/old_workflows/qa_pr_cpp_ol8.yml similarity index 100% rename from .github/workflows/qa_pr_cpp_ol8.yml rename to .github/old_workflows/qa_pr_cpp_ol8.yml diff --git a/.github/workflows/qa_pr_cpp_ubuntu.yml b/.github/old_workflows/qa_pr_cpp_ubuntu.yml similarity index 100% rename from .github/workflows/qa_pr_cpp_ubuntu.yml rename to .github/old_workflows/qa_pr_cpp_ubuntu.yml diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml new file mode 100644 index 00000000..7305409d --- /dev/null +++ b/.github/workflows/dev-ci.yml @@ -0,0 +1,270 @@ +name: Dev CI + +on: + workflow_dispatch: + pull_request: + +permissions: { } + +# 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 + +jobs: + java: + name: Build Java ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + + steps: + - name: Set up JDK 17 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + distribution: 'temurin' + java-version: '17' + + - name: Checkout sources + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - name: Build with Maven (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: ./mvnw --batch-mode -Pjacoco install + + - name: Build with Maven (Windows) + if: matrix.os == 'windows-latest' + run: mvnw.cmd --batch-mode install + shell: cmd + + - name: Build with Maven (MacOS) + if: matrix.os == 'macos-latest' + run: ./mvnw --batch-mode install + + - name: Run SonarCloud analysis + if: matrix.os == 'ubuntu-latest' + run: > + ./mvnw --batch-mode -DskipTests sonar:sonar + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.organization=powsybl-ci-github + -Dsonar.projectKey=com.powsybl:powsybl-metrix + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + cpp_centos7: + name: Build C++ CentOS7 + runs-on: ubuntu-latest + container: 'centos:centos7' + steps: + - name: Update mirrors + run: | + sed -i s/mirror.centos.org/vault.centos.org/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/vault.centos.org/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/actions-setup-cmake@v1.13 + 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 + + cpp_oraclelinux8: + name: Build C++ Oracle Linux 8 + runs-on: ubuntu-latest + container: 'oraclelinux:8' + steps: + - name: Install Boost + run: | + yum update -y + yum install cmake make gcc gcc-c++ which git + dnf --enablerepo=ol8_codeready_builder install boost-static + + - name: Checkout sources + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - name: Configure 3rd parties + run: > + cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-ol8/external + + - name: Build 3rd parties + run: > + cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-ol8/external --parallel 2 + + - name: Configure CMake + run: > + cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build-ol8 + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-ol8/install + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-ol8 --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build-ol8 && ctest -j8 --output-on-failure + + cpp_ubuntu: + name: Build C++ Ubuntu + 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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 + + cpp_ubuntu_qa: + name: Short QA C++ Ubuntu + runs-on: ubuntu-latest + steps: + - name: Install Java 17 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + distribution: 'temurin' + java-version: '17' + + - 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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 From e89e73dc117fb6e0881a8cf793154f00bb7b152b Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Tue, 15 Oct 2024 20:06:20 +0200 Subject: [PATCH 02/16] try rework github workflows Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 7305409d..f22ba5ca 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -59,6 +59,8 @@ jobs: name: Build C++ CentOS7 runs-on: ubuntu-latest container: 'centos:centos7' + env: + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - name: Update mirrors run: | From 73a818179216036ae5a8d08750db17815a047e7d Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 12:10:28 +0200 Subject: [PATCH 03/16] clang tidy Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 57 +++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index f22ba5ca..40038228 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -96,7 +96,7 @@ jobs: cmake-version: '3.22.x' - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@v3 - name: Download Boost-release uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1 @@ -270,3 +270,58 @@ jobs: run: > ${{ runner.workspace }}/sonar/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io + + cpp_clang_tidy: + name: Clang-tidy Report + runs-on: ubuntu-latest + steps: + - name: Install Boost + run: | + sudo apt-get update -y + sudo apt-get install -y libboost-all-dev + + - name: Install clang-tidy + run: | + sudo apt install -y clang-tidy-15 + sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100 + + - name: Checkout sources + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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 -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build + -DCMAKE_BUILD_TYPE=Debug + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + + - name: Generate Clang Tidy Report (Modified C++ sources in PR) + id: clang-pr + if: github.event_name == 'pull_request' + run: | + git fetch origin/${{ github.base_ref }} --depth 1 + REPORT_NAME="clang_tidy_report_pr.txt" + REPORT_PATH="$PWD/${REPORT_NAME}" + export METRIX_CPP_SOURCES=$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep -E ".*(metrix-simulator/src|metrix-simulator/log).*\.(cpp|hpp)$") + if [ -n "$METRIX_CPP_SOURCES" ]; then + clang-tidy $METRIX_CPP_SOURCES -p $GITHUB_WORKSPACE/metrix-simulator/build > $REPORT_NAME || true + echo "report_exists=true" >> "$GITHUB_OUTPUT" + echo "report_name=$REPORT_NAME" >> "$GITHUB_OUTPUT" + echo "report_path=$REPORT_PATH" >> "$GITHUB_OUTPUT" + else + echo "No C++ source file modification found in this PR, no Clang Tidy report will be generated" + fi + + - name: Upload Clang Tidy Report (Modified C++ sources in PR) + if: github.event_name == 'pull_request' && steps.clang-pr.outputs.report_exists + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 + with: + name: ${{ steps.clang-pr.outputs.report_name }} + path: ${{ steps.clang-pr.outputs.report_path }} From d4509457d96fc01a0cad99f0057f8b8f142d65c4 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 12:25:02 +0200 Subject: [PATCH 04/16] clang tidy Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 40038228..9e80e666 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -272,7 +272,7 @@ jobs: -Dsonar.host.url=https://sonarcloud.io cpp_clang_tidy: - name: Clang-tidy Report + name: Clang Tidy Report runs-on: ubuntu-latest steps: - name: Install Boost @@ -285,8 +285,13 @@ jobs: sudo apt install -y clang-tidy-15 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100 + - name: 'PR Fetch Depth' + run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" + - name: Checkout sources uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + with: + fetch-depth: ${{ env.PR_FETCH_DEPTH }} - name: Configure 3rd parties run: > @@ -306,7 +311,6 @@ jobs: id: clang-pr if: github.event_name == 'pull_request' run: | - git fetch origin/${{ github.base_ref }} --depth 1 REPORT_NAME="clang_tidy_report_pr.txt" REPORT_PATH="$PWD/${REPORT_NAME}" export METRIX_CPP_SOURCES=$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep -E ".*(metrix-simulator/src|metrix-simulator/log).*\.(cpp|hpp)$") From fc6491baef8d7e59f08c93072fe012060926c17a Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 12:40:19 +0200 Subject: [PATCH 05/16] clang tidy Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 9e80e666..2389ef6a 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -274,6 +274,7 @@ jobs: cpp_clang_tidy: name: Clang Tidy Report runs-on: ubuntu-latest + if: github.event_name == 'pull_request' # github.base_ref exists only for PRs steps: - name: Install Boost run: | @@ -285,13 +286,11 @@ jobs: sudo apt install -y clang-tidy-15 sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100 - - name: 'PR Fetch Depth' - run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" - - name: Checkout sources uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - with: - fetch-depth: ${{ env.PR_FETCH_DEPTH }} + run: | + git fetch --no-tags --depth=1 origin ${{ github.base_ref }} + git show-ref - name: Configure 3rd parties run: > @@ -309,7 +308,6 @@ jobs: - name: Generate Clang Tidy Report (Modified C++ sources in PR) id: clang-pr - if: github.event_name == 'pull_request' run: | REPORT_NAME="clang_tidy_report_pr.txt" REPORT_PATH="$PWD/${REPORT_NAME}" @@ -324,7 +322,7 @@ jobs: fi - name: Upload Clang Tidy Report (Modified C++ sources in PR) - if: github.event_name == 'pull_request' && steps.clang-pr.outputs.report_exists + if: steps.clang-pr.outputs.report_exists uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 with: name: ${{ steps.clang-pr.outputs.report_name }} From cf78812546dc6c915a5d08030741bcb32e3ca9d9 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 12:45:39 +0200 Subject: [PATCH 06/16] clang tidy Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 2389ef6a..78b09629 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -288,7 +288,9 @@ jobs: - name: Checkout sources uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - run: | + + - name: Fetch git base ref + run: > git fetch --no-tags --depth=1 origin ${{ github.base_ref }} git show-ref From e90f5cd999efd80c4d503555836f6bfe025303f4 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 12:46:57 +0200 Subject: [PATCH 07/16] clang tidy Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 78b09629..9efb7902 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -290,7 +290,7 @@ jobs: uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - name: Fetch git base ref - run: > + run: | git fetch --no-tags --depth=1 origin ${{ github.base_ref }} git show-ref From ba6aa9fcfc2826daf73d51d8edccedc4aeb88cf0 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 12:54:08 +0200 Subject: [PATCH 08/16] clang tidy Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 9efb7902..27a675fe 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -291,7 +291,7 @@ jobs: - name: Fetch git base ref run: | - git fetch --no-tags --depth=1 origin ${{ github.base_ref }} + git fetch --no-tags --depth=1 origin ${{ github.base_ref }} ${{ github.head_ref }} git show-ref - name: Configure 3rd parties From 0f32175cbe3172839aa7ff1e9128c691f9ec5e8b Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 14:18:27 +0200 Subject: [PATCH 09/16] artifacts Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 73 ++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 27a675fe..f900e280 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -2,6 +2,12 @@ name: Dev CI on: workflow_dispatch: + inputs: + generate_artifacts: + description: 'Generate and upload build artifacts' + required: true + default: false + type: boolean pull_request: permissions: { } @@ -55,6 +61,13 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Upload Metrix iTools archive + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 + with: + name: itools-metrix + path: ${{ github.workspace }}/metrix-distribution/target/itools-metrix.zip + cpp_centos7: name: Build C++ CentOS7 runs-on: ubuntu-latest @@ -129,6 +142,24 @@ jobs: - name: Tests run: cd $GITHUB_WORKSPACE/metrix-simulator/build-centos7 && ctest -j2 --output-on-failure + - name: Prepare Metrix Simulator archive + id: metrix-archive + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + run: | + ARCHIVE_NAME="metrix-simulator-centos7" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload Metrix Simulator archive + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.metrix-archive.outputs.archive_name }}.zip + path: ${{ steps.metrix-archive.outputs.archive_path }}.zip + cpp_oraclelinux8: name: Build C++ Oracle Linux 8 runs-on: ubuntu-latest @@ -163,6 +194,24 @@ jobs: - name: Tests run: cd $GITHUB_WORKSPACE/metrix-simulator/build-ol8 && ctest -j8 --output-on-failure + - name: Prepare Metrix Simulator archive + id: metrix-archive + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + run: | + ARCHIVE_NAME="metrix-simulator-ol8" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload Metrix Simulator archive + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 + with: + name: ${{ steps.metrix-archive.outputs.archive_name }}.zip + path: ${{ steps.metrix-archive.outputs.archive_path }}.zip + cpp_ubuntu: name: Build C++ Ubuntu runs-on: ubuntu-latest @@ -195,6 +244,24 @@ jobs: - name: Tests run: cd $GITHUB_WORKSPACE/metrix-simulator/build-linux && ctest -j8 --output-on-failure + - name: Prepare Metrix Simulator archive + id: metrix-archive + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + run: | + ARCHIVE_NAME="metrix-simulator-ubuntu" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload OR-Tools install artifact + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 + with: + name: ${{ steps.metrix-archive.outputs.archive_name }}.zip + path: ${{ steps.metrix-archive.outputs.archive_path }}.zip + cpp_ubuntu_qa: name: Short QA C++ Ubuntu runs-on: ubuntu-latest @@ -272,7 +339,7 @@ jobs: -Dsonar.host.url=https://sonarcloud.io cpp_clang_tidy: - name: Clang Tidy Report + name: Clang Tidy Report (PR only) runs-on: ubuntu-latest if: github.event_name == 'pull_request' # github.base_ref exists only for PRs steps: @@ -289,7 +356,7 @@ jobs: - name: Checkout sources uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - name: Fetch git base ref + - name: Git fetch base_ref and head_ref run: | git fetch --no-tags --depth=1 origin ${{ github.base_ref }} ${{ github.head_ref }} git show-ref @@ -308,7 +375,7 @@ jobs: -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - - name: Generate Clang Tidy Report (Modified C++ sources in PR) + - name: Generate Clang Tidy Report (Modified C++ sources only) id: clang-pr run: | REPORT_NAME="clang_tidy_report_pr.txt" From c13fbf2755bf7b903714e7ede93f83c09be02921 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 14:22:52 +0200 Subject: [PATCH 10/16] artifacts Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index f900e280..b893ba59 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -1,6 +1,9 @@ name: Dev CI on: + push: + branches: + - "gh-workflows" # FIXME - TEMP / REMOVE ME workflow_dispatch: inputs: generate_artifacts: From 3067cb027801f2aa559a88e90782bc7eecb4b47e Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 14:25:57 +0200 Subject: [PATCH 11/16] artifacts Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index b893ba59..6085a539 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -12,6 +12,11 @@ on: default: false type: boolean pull_request: + # FIXME - TEMP / REMOVE ME below + branches: + - "main" + paths: + - ".github/workflows/dev-ci.yml" permissions: { } From 723273ba28c8642ddcc06464d3c23e5196d07a40 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 16 Oct 2024 14:59:53 +0200 Subject: [PATCH 12/16] artifacts Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 105 ++++++++++++----------------------- 1 file changed, 37 insertions(+), 68 deletions(-) diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 6085a539..6f048dea 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -1,9 +1,6 @@ name: Dev CI on: - push: - branches: - - "gh-workflows" # FIXME - TEMP / REMOVE ME workflow_dispatch: inputs: generate_artifacts: @@ -12,11 +9,6 @@ on: default: false type: boolean pull_request: - # FIXME - TEMP / REMOVE ME below - branches: - - "main" - paths: - - ".github/workflows/dev-ci.yml" permissions: { } @@ -69,12 +61,16 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + - name: Get Maven version + if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + run: echo "MAVEN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV + - name: Upload Metrix iTools archive - if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 with: - name: itools-metrix - path: ${{ github.workspace }}/metrix-distribution/target/itools-metrix.zip + name: itools-metrix-${{ env.MAVEN_PROJECT_VERSION }} + path: ${{ github.workspace }}/metrix-distribution/target/metrix cpp_centos7: name: Build C++ CentOS7 @@ -133,40 +129,31 @@ jobs: - 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 + 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-centos7/external --parallel 2 + cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/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 + 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/install -B $GITHUB_WORKSPACE/metrix-simulator/build - name: Build - run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-centos7 --target install --parallel 2 + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 - name: Tests - run: cd $GITHUB_WORKSPACE/metrix-simulator/build-centos7 && ctest -j2 --output-on-failure - - - name: Prepare Metrix Simulator archive - id: metrix-archive - if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} - run: | - ARCHIVE_NAME="metrix-simulator-centos7" - ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" - cd metrix-simulator/build/install/ - zip -r $ARCHIVE_PATH bin etc - echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" - echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure - name: Upload Metrix Simulator archive if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} uses: actions/upload-artifact@v3 with: - name: ${{ steps.metrix-archive.outputs.archive_name }}.zip - path: ${{ steps.metrix-archive.outputs.archive_path }}.zip + name: metrix-simulator-centos7 + path: | + metrix-simulator/build/install/bin + metrix-simulator/build/install/etc cpp_oraclelinux8: name: Build C++ Oracle Linux 8 @@ -184,41 +171,32 @@ jobs: - name: Configure 3rd parties run: > - cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-ol8/external + 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-ol8/external --parallel 2 + 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-ol8 + cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-ol8/install + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install - name: Build - run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-ol8 --target install --parallel 2 + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 - name: Tests - run: cd $GITHUB_WORKSPACE/metrix-simulator/build-ol8 && ctest -j8 --output-on-failure - - - name: Prepare Metrix Simulator archive - id: metrix-archive - if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} - run: | - ARCHIVE_NAME="metrix-simulator-ol8" - ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" - cd metrix-simulator/build/install/ - zip -r $ARCHIVE_PATH bin etc - echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" - echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j8 --output-on-failure - name: Upload Metrix Simulator archive if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 with: - name: ${{ steps.metrix-archive.outputs.archive_name }}.zip - path: ${{ steps.metrix-archive.outputs.archive_path }}.zip + name: metrix-simulator-ol8 + path: | + metrix-simulator/build/install/bin + metrix-simulator/build/install/etc cpp_ubuntu: name: Build C++ Ubuntu @@ -234,41 +212,32 @@ jobs: - name: Configure 3rd parties run: > - cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-linux/external + 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-linux/external --parallel 2 + 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-linux + cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-linux/install + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install - name: Build - run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-linux --target install --parallel 2 + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --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 && ctest -j8 --output-on-failure - - name: Prepare Metrix Simulator archive - id: metrix-archive - if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} - run: | - ARCHIVE_NAME="metrix-simulator-ubuntu" - ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" - cd metrix-simulator/build/install/ - zip -r $ARCHIVE_PATH bin etc - echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" - echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - - - name: Upload OR-Tools install artifact + - name: Upload Metrix Simulator archive if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 with: - name: ${{ steps.metrix-archive.outputs.archive_name }}.zip - path: ${{ steps.metrix-archive.outputs.archive_path }}.zip + name: metrix-simulator-ubuntu + path: | + metrix-simulator/build/install/bin + metrix-simulator/build/install/etc cpp_ubuntu_qa: name: Short QA C++ Ubuntu From a9528ad35000746fdf61746d55ff9794a77356b7 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Fri, 18 Oct 2024 16:03:07 +0200 Subject: [PATCH 13/16] wip Signed-off-by: Damien Jeandemange --- .github/workflows/dev-ci.yml | 6 +- .github/workflows/full-ci.yml | 322 +++++++++++++++++++++++++++++++ .github/workflows/release-ci.yml | 240 +++++++++++++++++++++++ 3 files changed, 565 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/full-ci.yml create mode 100644 .github/workflows/release-ci.yml diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index 6f048dea..e96cde98 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -187,7 +187,7 @@ jobs: run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 - name: Tests - run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j8 --output-on-failure + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure - name: Upload Metrix Simulator archive if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} @@ -228,7 +228,7 @@ jobs: run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 - name: Tests - run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j8 --output-on-failure + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure - name: Upload Metrix Simulator archive if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} @@ -301,7 +301,7 @@ jobs: 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 + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure - name: Code coverage run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target code-coverage diff --git a/.github/workflows/full-ci.yml b/.github/workflows/full-ci.yml new file mode 100644 index 00000000..a2113e7e --- /dev/null +++ b/.github/workflows/full-ci.yml @@ -0,0 +1,322 @@ +name: Full CI + +on: + push: + branches: + - main + - 'release-v**' + - 'full-sonar-analysis-**' + tags: + - 'v[0-9]+.[0-9]+.[0-9]+*' + +permissions: { } + +# 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 + +jobs: + java: + name: Build Java ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + + steps: + - name: Set up JDK 17 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + distribution: 'temurin' + java-version: '17' + + - name: Checkout sources + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - name: Build with Maven (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: ./mvnw --batch-mode -Pjacoco install + + - name: Build with Maven (Windows) + if: matrix.os == 'windows-latest' + run: mvnw.cmd --batch-mode install + shell: cmd + + - name: Build with Maven (MacOS) + if: matrix.os == 'macos-latest' + run: ./mvnw --batch-mode install + + - name: Run SonarCloud analysis + if: matrix.os == 'ubuntu-latest' + run: > + ./mvnw --batch-mode -DskipTests sonar:sonar + -Dsonar.host.url=https://sonarcloud.io + -Dsonar.organization=powsybl-ci-github + -Dsonar.projectKey=com.powsybl:powsybl-metrix + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + cpp_centos7: + name: Build C++ CentOS7 + runs-on: ubuntu-latest + container: 'centos:centos7' + env: + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true + steps: + - name: Update mirrors + run: | + sed -i s/mirror.centos.org/vault.centos.org/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/vault.centos.org/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/actions-setup-cmake@v1.13 + with: + cmake-version: '3.22.x' + + - name: Checkout sources + uses: actions/checkout@v3 + + - 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/external + + - name: Build 3rd parties + run: | + cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/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/install -B $GITHUB_WORKSPACE/metrix-simulator/build + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + + cpp_oraclelinux8: + name: Build C++ Oracle Linux 8 + runs-on: ubuntu-latest + container: 'oraclelinux:8' + steps: + - name: Install Boost + run: | + yum update -y + yum install cmake make gcc gcc-c++ which git + dnf --enablerepo=ol8_codeready_builder install boost-static + + - name: Checkout sources + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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=Release + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + + cpp_ubuntu: + name: Build C++ Ubuntu + 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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=Release + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + + cpp_ubuntu_qa: + name: Full QA C++ Ubuntu + runs-on: ubuntu-latest + steps: + - name: Install Java 17 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + distribution: 'temurin' + java-version: '17' + + - 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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=ON + -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 -j2 --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 + + cpp_clang_tidy: + name: Clang Tidy Report + runs-on: ubuntu-latest + steps: + - name: Install Boost + run: | + sudo apt-get update -y + sudo apt-get install -y libboost-all-dev + + - name: Install clang-tidy + run: | + sudo apt install -y clang-tidy-15 + sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100 + + - name: Checkout sources + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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 -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build + -DCMAKE_BUILD_TYPE=Debug + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + + - name: Generate Clang Tidy Report (All C++ sources) + id: clang-pr + run: | + REPORT_NAME="clang_tidy_report_all.txt" + REPORT_PATH="$PWD/${REPORT_NAME}" + export METRIX_CPP_SOURCES=$(find metrix-simulator/log/ metrix-simulator/src/ -type f | grep -E ".*(metrix-simulator/src|metrix-simulator/log).*\.(cpp|hpp)$") + clang-tidy $METRIX_CPP_SOURCES -p $GITHUB_WORKSPACE/metrix-simulator/build > $REPORT_NAME || true + + - name: Upload Clang Tidy Report (All C++ sources) + uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 + with: + name: ${{ steps.clang-pr.outputs.report_name }} + path: ${{ steps.clang-pr.outputs.report_path }} diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml new file mode 100644 index 00000000..07baf942 --- /dev/null +++ b/.github/workflows/release-ci.yml @@ -0,0 +1,240 @@ +name: Release CI + +on: + release: + types: + - created + +permissions: + contents: write + +jobs: + java: + name: Package Java + runs-on: ubuntu-latest + + steps: + - name: Set up JDK 17 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + with: + distribution: 'temurin' + java-version: '17' + + - name: Checkout sources + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - name: Package with Maven + run: ./mvnw --batch-mode package + + - name: Get Maven version + run: echo "MAVEN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV + + - name: Upload release package + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./metrix-distribution/target/itools-metrix.zip + asset_name: itools-metrix-${{ env.MAVEN_PROJECT_VERSION }}.zip + asset_content_type: application/zip + + cpp_centos7: + name: Package C++ CentOS7 + runs-on: ubuntu-latest + container: 'centos:centos7' + env: + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true + steps: + - name: Update mirrors + run: | + sed -i s/mirror.centos.org/vault.centos.org/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/vault.centos.org/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/actions-setup-cmake@v1.13 + with: + cmake-version: '3.22.x' + + - name: Checkout sources + uses: actions/checkout@v3 + + - 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/external + + - name: Build 3rd parties + run: | + cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/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/install -B $GITHUB_WORKSPACE/metrix-simulator/build + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + + - name: Prepare Metrix package + id: metrix-install + run: | + ARCHIVE_NAME="metrix-simulator-centos7" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload release package + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip + asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip + asset_content_type: application/zip + + cpp_oraclelinux8: + name: Build C++ Oracle Linux 8 + runs-on: ubuntu-latest + container: 'oraclelinux:8' + steps: + - name: Install Boost + run: | + yum update -y + yum install cmake make gcc gcc-c++ which git + dnf --enablerepo=ol8_codeready_builder install boost-static + + - name: Checkout sources + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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=Release + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + + - name: Prepare Metrix package + id: metrix-install + run: | + ARCHIVE_NAME="metrix-simulator-ol8" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload release package + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip + asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip + asset_content_type: application/zip + + cpp_ubuntu: + name: Build C++ Ubuntu + 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + + - 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=Release + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install + + - name: Build + run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 + + - name: Tests + run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + + - name: Prepare Metrix package + id: metrix-install + run: | + ARCHIVE_NAME="metrix-simulator-ubuntu" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload release package + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip + asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip + asset_content_type: application/zip From b1c03bebee335fa30a9ebfe8907aea09b0ff166c Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Fri, 18 Oct 2024 16:40:45 +0200 Subject: [PATCH 14/16] fix Signed-off-by: Damien Jeandemange --- .github/workflows/release-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index 07baf942..f09ee1cf 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -134,7 +134,7 @@ jobs: asset_content_type: application/zip cpp_oraclelinux8: - name: Build C++ Oracle Linux 8 + name: Package C++ Oracle Linux 8 runs-on: ubuntu-latest container: 'oraclelinux:8' steps: @@ -188,7 +188,7 @@ jobs: asset_content_type: application/zip cpp_ubuntu: - name: Build C++ Ubuntu + name: Package C++ Ubuntu runs-on: ubuntu-latest steps: - name: Install Boost From 82bb2fb09f3497547c074d40321414e2980812a8 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 6 Nov 2024 14:18:10 +0100 Subject: [PATCH 15/16] use softprops/action-gh-release Signed-off-by: Damien Jeandemange --- .github/workflows/release-ci.yml | 41 +++++++------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index f09ee1cf..4ca5c84f 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -26,18 +26,10 @@ jobs: - name: Package with Maven run: ./mvnw --batch-mode package - - name: Get Maven version - run: echo "MAVEN_PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV - - name: Upload release package - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ./metrix-distribution/target/itools-metrix.zip - asset_name: itools-metrix-${{ env.MAVEN_PROJECT_VERSION }}.zip - asset_content_type: application/zip + files: ./metrix-distribution/target/itools-metrix.zip cpp_centos7: name: Package C++ CentOS7 @@ -124,14 +116,9 @@ jobs: echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - name: Upload release package - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip - asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip - asset_content_type: application/zip + files: ${{ steps.metrix-install.outputs.archive_path }}.zip cpp_oraclelinux8: name: Package C++ Oracle Linux 8 @@ -141,7 +128,7 @@ jobs: - name: Install Boost run: | yum update -y - yum install cmake make gcc gcc-c++ which git + yum install cmake make gcc gcc-c++ which git zip dnf --enablerepo=ol8_codeready_builder install boost-static - name: Checkout sources @@ -178,14 +165,9 @@ jobs: echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - name: Upload release package - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip - asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip - asset_content_type: application/zip + files: ${{ steps.metrix-install.outputs.archive_path }}.zip cpp_ubuntu: name: Package C++ Ubuntu @@ -230,11 +212,6 @@ jobs: echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - name: Upload release package - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip - asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip - asset_content_type: application/zip + files: ${{ steps.metrix-install.outputs.archive_path }}.zip From 2b48cfc0c54f6f3825ed3f2de68f11ebd0be2add Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 6 Nov 2024 16:25:53 +0100 Subject: [PATCH 16/16] fix Signed-off-by: Damien Jeandemange --- .github/old_workflows/ci_centos7.yml | 99 ------ .github/old_workflows/ci_ol8.yml | 58 ---- .github/old_workflows/ci_ubuntu.yml | 132 -------- .github/old_workflows/maven.yml | 62 ---- .github/old_workflows/qa_pr_cpp_centos7.yml | 350 -------------------- .github/old_workflows/qa_pr_cpp_ol8.yml | 209 ------------ .github/old_workflows/qa_pr_cpp_ubuntu.yml | 222 ------------- .github/workflows/full-ci.yml | 1 + .github/workflows/release-ci.yml | 8 +- 9 files changed, 5 insertions(+), 1136 deletions(-) delete mode 100644 .github/old_workflows/ci_centos7.yml delete mode 100644 .github/old_workflows/ci_ol8.yml delete mode 100644 .github/old_workflows/ci_ubuntu.yml delete mode 100644 .github/old_workflows/maven.yml delete mode 100644 .github/old_workflows/qa_pr_cpp_centos7.yml delete mode 100644 .github/old_workflows/qa_pr_cpp_ol8.yml delete mode 100644 .github/old_workflows/qa_pr_cpp_ubuntu.yml diff --git a/.github/old_workflows/ci_centos7.yml b/.github/old_workflows/ci_centos7.yml deleted file mode 100644 index 5f45611f..00000000 --- a/.github/old_workflows/ci_centos7.yml +++ /dev/null @@ -1,99 +0,0 @@ -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/vault.centos.org/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/vault.centos.org/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/actions-setup-cmake@v1.13 - 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 \ No newline at end of file diff --git a/.github/old_workflows/ci_ol8.yml b/.github/old_workflows/ci_ol8.yml deleted file mode 100644 index 61802d39..00000000 --- a/.github/old_workflows/ci_ol8.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: CI-cpp-ol8 - -on: - workflow_dispatch: {} - pull_request: - types: [opened, ready_for_review, reopened] - push: - paths: - - 'metrix-simulator/**' - - '.github/workflows/ci_ol8.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 - -jobs: - linux: - name: Tests C++ Oracle Linux 8 - runs-on: ubuntu-latest - container: 'oraclelinux:8' - steps: - - name: Install Boost - run: | - yum update -y - yum install cmake make gcc gcc-c++ which git - dnf --enablerepo=ol8_codeready_builder install boost-static - - - name: Checkout sources - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - name: Configure 3rd parties - run: > - cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-ol8/external - - - name: Build 3rd parties - run: > - cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-ol8/external --parallel 2 - - - name: Configure CMake - run: > - cmake -Wno-dev -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build-ol8 - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build-ol8/install - - - name: Build - run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-ol8 --target install --parallel 2 - - - name: Tests - run: cd $GITHUB_WORKSPACE/metrix-simulator/build-ol8 && ctest -j8 --output-on-failure \ No newline at end of file diff --git a/.github/old_workflows/ci_ubuntu.yml b/.github/old_workflows/ci_ubuntu.yml deleted file mode 100644 index e0573af4..00000000 --- a/.github/old_workflows/ci_ubuntu.yml +++ /dev/null @@ -1,132 +0,0 @@ -name: CI-cpp-ubuntu - -on: - workflow_dispatch: {} - pull_request: - types: [opened, ready_for_review, reopened] - push: - paths: - - 'metrix-simulator/**' - - '.github/workflows/ci_ubuntu.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 - -jobs: - linux: - name: Tests C++ Ubuntu - 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - 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: Short QA C++ Ubuntu - runs-on: ubuntu-latest - steps: - - name: Install Java 17 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 - with: - distribution: 'temurin' - java-version: '17' - - - 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - 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 diff --git a/.github/old_workflows/maven.yml b/.github/old_workflows/maven.yml deleted file mode 100644 index acfdbc8a..00000000 --- a/.github/old_workflows/maven.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: CI-java - -on: - push: - branches: - - 'main' - - 'release-v**' - - 'full-sonar-analysis-**' - pull_request: - release: - types: [published] - -permissions: {} - -# 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 - -jobs: - build: - name: Build Java on OS ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - - steps: - - name: Set up JDK 17 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 - with: - distribution: 'temurin' - java-version: '17' - - - name: Checkout sources - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - name: Build with Maven (Ubuntu) - if: matrix.os == 'ubuntu-latest' - run: ./mvnw --batch-mode -Pjacoco install - - - name: Build with Maven (Windows) - if: matrix.os == 'windows-latest' - run: mvnw.cmd --batch-mode install - shell: cmd - - - name: Build with Maven (MacOS) - if: matrix.os == 'macos-latest' - run: ./mvnw --batch-mode install - - - name: Run SonarCloud analysis - if: matrix.os == 'ubuntu-latest' - run: > - ./mvnw --batch-mode -DskipTests sonar:sonar - -Dsonar.host.url=https://sonarcloud.io - -Dsonar.organization=powsybl-ci-github - -Dsonar.projectKey=com.powsybl:powsybl-metrix - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/old_workflows/qa_pr_cpp_centos7.yml b/.github/old_workflows/qa_pr_cpp_centos7.yml deleted file mode 100644 index 650b0ab0..00000000 --- a/.github/old_workflows/qa_pr_cpp_centos7.yml +++ /dev/null @@ -1,350 +0,0 @@ -name: QA-PR-CPP-CENTOS7 - -on: - workflow_dispatch: - pull_request: - types: [opened, ready_for_review, reopened] - release: - types: [published] - push: - paths: - - '.github/workflows/qa_pr_cpp_centos7.yml' - -# 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 - -env: - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true - -jobs: - clang-tidy: - name: Clang-tidy CentOS - runs-on: ubuntu-latest - container: 'centos:centos7' - steps: - - name: Update mirrors - run: | - sed -i s/mirror.centos.org/vault.centos.org/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/vault.centos.org/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/actions-setup-cmake@v1.13 - 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: Install clang-tidy - run: | - yum install -y centos-release-scl - yum install -y llvm-toolset-7.0 - scl enable llvm-toolset-7.0 bash - - - 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 -B $GITHUB_WORKSPACE/metrix-simulator/build-centos7 -DCMAKE_BUILD_TYPE=Debug -DBoost_ROOT=$GITHUB_WORKSPACE/__w/Boost/Boost/boost_1_73_0/installBoost -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - - - name: Clang Tidy PR - id: clang-pr - if: github.event_name == 'pull_request' - run: | - REPORT_NAME="clang_tidy_report_centos.txt" - REPORT_PATH="$PWD/${REPORT_NAME}" - export MODIFIED_FILES=$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep -E ".*(metrix-simulator/src|metrix-simulator/log).*\.(cpp|hpp)$") - if [ -n "$MODIFIED_FILES" ]; then - clang-tidy $MODIFIED_FILES -p $GITHUB_WORKSPACE/metrix-simulator/build-centos7 > $REPORT_NAME || true - fi - echo "report_name=$REPORT_NAME" >> "$GITHUB_OUTPUT" - echo "report_path=$REPORT_PATH" >> "$GITHUB_OUTPUT" - - - name: Upload Clang Tidy report - PR - if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.clang-pr.outputs.report_name }} - path: ${{ steps.clang-pr.outputs.report_path }} - -# - name: Clang Tidy Release -# id: clang-release -# if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' -# run: | -# REPORT_NAME="clang_tidy_report_centos.txt" -# REPORT_PATH="$PWD/${REPORT_NAME}" -# export MODIFIED_FILES=$(find metrix-simulator/log/ metrix-simulator/src/ -type f | grep -E ".*(metrix-simulator/src|metrix-simulator/log).*\.(cpp|hpp)$") -# if [ -n "$MODIFIED_FILES" ]; then -# clang-tidy $MODIFIED_FILES -p $GITHUB_WORKSPACE/metrix-simulator/build > $REPORT_NAME || true -# cat clan_tidy_report_centos.txt # Display the contents of the report -# exit_code=$? -# if [ $exit_code -ne 0 ]; then -# echo "clang-tidy failed with exit code $exit_code" -# exit $exit_code -# fi -# fi -# echo "report_name=$REPORT_NAME" >> "$GITHUB_OUTPUT" -# echo "report_path=$REPORT_PATH" >> "$GITHUB_OUTPUT" -# -# - name: Upload Clang Tidy report - Release -# if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' -# uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 -# with: -# name: ${{ steps.clang-release.outputs.report_name }} -# path: ${{ steps.clang-release.outputs.report_path }} - - qa: - name: Full QA C++ CentOS - runs-on: ubuntu-latest - container: 'centos:centos7' - steps: - - name: Update mirrors - run: | - sed -i s/mirror.centos.org/vault.centos.org/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/vault.centos.org/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: Install Dependencies 4 - run: | - yum install -y python3 python3-pip - - - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.13 - with: - cmake-version: '3.22.x' - - - name: Install Java 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - - - name: Install gcovr - run: | - yum -y install libxml2-devel libxslt-devel - yum -y clean all - pip3 install wheel - pip3 install gcovr cpplint lxml==4.9.4 - - - name: Install Sonar wrapper - working-directory: /__w/powsybl-metrix - run: | - wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip - unzip build-wrapper-linux-x86.zip - - - name: Install Sonar scanner - working-directory: /__w/powsybl-metrix - 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: 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/external - - - name: Build 3rd parties - run: | - cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/external --parallel 2 - - - 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 -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 -DCODE_COVERAGE=TRUE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install - - - name: Build-Sonar - run: | - /__w/powsybl-metrix/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 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - cd metrix-simulator - /__w/powsybl-metrix/sonar/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io - - release: - name: Release CentOS7 - runs-on: ubuntu-latest - container: 'centos:centos7' - needs: qa - if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - steps: - - name: Update mirrors - run: | - sed -i s/mirror.centos.org/vault.centos.org/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/vault.centos.org/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/actions-setup-cmake@v1.13 - 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/external - - - name: Build 3rd parties - run: | - cmake --build $GITHUB_WORKSPACE/metrix-simulator/build/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/install -B $GITHUB_WORKSPACE/metrix-simulator/build - - - name: Build - run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 - - - name: Prepare Metrix install - id: metrix-install - run: | - ARCHIVE_NAME="metrix-simulator-centos7" - ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" - cd metrix-simulator/build/install/ - zip -r $ARCHIVE_PATH bin etc - echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" - echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - - - name: Upload OR-Tools install artifact - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.metrix-install.outputs.archive_name }}.zip - path: ${{ steps.metrix-install.outputs.archive_path }}.zip - - - name: Upload asset to release - uses: softprops/action-gh-release@v1 - if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') - with: - files: ${{ steps.metrix-install.outputs.archive_name }}.zip \ No newline at end of file diff --git a/.github/old_workflows/qa_pr_cpp_ol8.yml b/.github/old_workflows/qa_pr_cpp_ol8.yml deleted file mode 100644 index 87c51050..00000000 --- a/.github/old_workflows/qa_pr_cpp_ol8.yml +++ /dev/null @@ -1,209 +0,0 @@ -name: QA-PR-CPP-OL8 - -on: - workflow_dispatch: - pull_request: - types: [opened, ready_for_review, reopened] - release: - types: [published] - push: - paths: - - '.github/workflows/qa_pr_cpp_ol8.yml' - -# 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 - -jobs: - clang-tidy: - name: Clang-tidy Oracle Linux 8 - runs-on: ubuntu-latest - container: 'oraclelinux:8' - steps: - - name: Install Boost - run: | - yum update -y - yum install cmake make gcc gcc-c++ which git - dnf --enablerepo=ol8_codeready_builder install boost-static - - - name: Install clang-tidy - run: | - yum install -y llvm-toolset - - - name: Checkout sources - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - name: Configure 3rd parties - run: > - cmake -S $GITHUB_WORKSPACE/metrix-simulator/external -B $GITHUB_WORKSPACE/metrix-simulator/build-ol8/external - - - name: Build 3rd parties - run: > - cmake --build $GITHUB_WORKSPACE/metrix-simulator/build-ol8/external --parallel 2 - - - name: Configure CMake - run: > - cmake -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build-ol8 - -DCMAKE_BUILD_TYPE=Debug - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - - - name: Clang Tidy PR - id: clang-pr - if: github.event_name == 'pull_request' - run: | - REPORT_NAME="clang_tidy_report_ol8.txt" - REPORT_PATH="$PWD/${REPORT_NAME}" - export MODIFIED_FILES=$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep -E ".*(metrix-simulator/src|metrix-simulator/log).*\.(cpp|hpp)$") - if [ -n "$MODIFIED_FILES" ]; then - clang-tidy $MODIFIED_FILES -p $GITHUB_WORKSPACE/metrix-simulator/build-ol8 > $REPORT_NAME || true - fi - echo "report_name=$REPORT_NAME" >> "$GITHUB_OUTPUT" - echo "report_path=$REPORT_PATH" >> "$GITHUB_OUTPUT" - - - name: Upload Clang Tidy report - PR - if: github.event_name == 'pull_request' - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 - with: - name: ${{ steps.clang-pr.outputs.report_name }} - path: ${{ steps.clang-pr.outputs.report_path }} - - qa: - name: Full QA C++ Oracle Linux 8 - runs-on: ubuntu-latest - container: 'oraclelinux:8' - steps: - - name: Install Dependencies - run: | - yum update -y - yum install cmake make gcc gcc-c++ which git wget zip - dnf --enablerepo=ol8_codeready_builder install boost-static - yum install -y python3 python3-pip - - - name: Install Java 17 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 - with: - distribution: 'temurin' - java-version: '17' - - - name: Install gcovr - run: | - yum -y install libxml2-devel libxslt-devel - yum -y clean all - pip3 install wheel - pip3 install gcovr cpplint lxml==4.9.4 - - - name: Install Sonar wrapper - working-directory: /__w/powsybl-metrix - run: | - wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip - unzip build-wrapper-linux-x86.zip - - - name: Install Sonar scanner - working-directory: /__w/powsybl-metrix - 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: 5.0.1.3006 - - - name: Checkout sources - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - 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 - -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install - - - name: Build-Sonar - run: > - /__w/powsybl-metrix/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 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - cd metrix-simulator - /__w/powsybl-metrix/sonar/bin/sonar-scanner -Dsonar.host.url=https://sonarcloud.io - - release: - name: Release Oracle Linux 8 - runs-on: ubuntu-latest - container: 'oraclelinux:8' - needs: qa - if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - steps: - - name: Install Dependencies - run: | - yum update -y - yum install cmake make gcc gcc-c++ which git wget zip - dnf --enablerepo=ol8_codeready_builder install boost-static - - - name: Checkout sources - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - 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=Release - -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install - - - name: Build - run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 - - - name: Prepare Metrix install - id: metrix-install - run: | - ARCHIVE_NAME="metrix-simulator-ol8" - ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" - cd metrix-simulator/build/install/ - zip -r $ARCHIVE_PATH bin etc - echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" - echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - - - name: Upload OR-Tools install artifact - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 - with: - name: ${{ steps.metrix-install.outputs.archive_name }}.zip - path: ${{ steps.metrix-install.outputs.archive_path }}.zip - - - name: Upload asset to release - uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # 2.0.4 - if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') - with: - files: ${{ steps.metrix-install.outputs.archive_name }}.zip \ No newline at end of file diff --git a/.github/old_workflows/qa_pr_cpp_ubuntu.yml b/.github/old_workflows/qa_pr_cpp_ubuntu.yml deleted file mode 100644 index a48200de..00000000 --- a/.github/old_workflows/qa_pr_cpp_ubuntu.yml +++ /dev/null @@ -1,222 +0,0 @@ -name: QA-PR-CPP-UBUNTU - -on: - workflow_dispatch: - pull_request: - types: [opened, ready_for_review, reopened] - release: - types: [published] - push: - paths: - - '.github/workflows/qa_pr_cpp_ubuntu.yml' - -# 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 - -jobs: - clang-tidy: - name: Clang-tidy Ubuntu - runs-on: ubuntu-latest - steps: - - name: Install Boost - run: | - sudo apt-get update -y - sudo apt-get install -y libboost-all-dev - - - name: Install clang-tidy - run: | - sudo apt install -y clang-tidy-15 - sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-15 100 - - - name: Checkout sources - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - 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 -S $GITHUB_WORKSPACE/metrix-simulator -B $GITHUB_WORKSPACE/metrix-simulator/build - -DCMAKE_BUILD_TYPE=Debug - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - - - name: Clang Tidy PR - id: clang-pr - if: github.event_name == 'pull_request' - run: | - REPORT_NAME="clang_tidy_report_ubuntu.txt" - REPORT_PATH="$PWD/${REPORT_NAME}" - export MODIFIED_FILES=$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }} origin/${{ github.head_ref }} | grep -E ".*(metrix-simulator/src|metrix-simulator/log).*\.(cpp|hpp)$") - if [ -n "$MODIFIED_FILES" ]; then - clang-tidy $MODIFIED_FILES -p $GITHUB_WORKSPACE/metrix-simulator/build > $REPORT_NAME || true - fi - echo "report_name=$REPORT_NAME" >> "$GITHUB_OUTPUT" - echo "report_path=$REPORT_PATH" >> "$GITHUB_OUTPUT" - - - name: Upload Clang Tidy report - PR - if: github.event_name == 'pull_request' - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 - with: - name: ${{ steps.clang-pr.outputs.report_name }} - path: ${{ steps.clang-pr.outputs.report_path }} - - - name: Clang Tidy Release - id: clang-release - if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - run: | - REPORT_NAME="clang_tidy_report_ubuntu.txt" - REPORT_PATH="$PWD/${REPORT_NAME}" - export MODIFIED_FILES=$(find metrix-simulator/log/ metrix-simulator/src/ -type f | grep -E ".*(metrix-simulator/src|metrix-simulator/log).*\.(cpp|hpp)$") - if [ -n "$MODIFIED_FILES" ]; then - clang-tidy $MODIFIED_FILES -p $GITHUB_WORKSPACE/metrix-simulator/build > $REPORT_NAME || true - fi - echo "report_name=$REPORT_NAME" >> "$GITHUB_OUTPUT" - echo "report_path=$REPORT_PATH" >> "$GITHUB_OUTPUT" - - - name: Upload Clang Tidy report - Release - if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 - with: - name: ${{ steps.clang-release.outputs.report_name }} - path: ${{ steps.clang-release.outputs.report_path }} - - qa: - name: Full QA C++ Ubuntu - runs-on: ubuntu-latest - steps: - - name: Install Java 17 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 - with: - distribution: 'temurin' - java-version: '17' - - - 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - 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 - -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 - - release: - name: Release Ubuntu - runs-on: ubuntu-latest - needs: qa - if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - steps: - - name: Install Boost - run: | - sudo apt-get update -y - sudo apt-get install -y libboost-all-dev - - - name: Checkout sources - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - - 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=Release - -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/metrix-simulator/build/install - - - name: Build - run: cmake --build $GITHUB_WORKSPACE/metrix-simulator/build --target install --parallel 2 - - - name: Prepare Metrix install - id: metrix-install - run: | - ARCHIVE_NAME="metrix-simulator-ubuntu" - ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" - cd metrix-simulator/build/install/ - zip -r $ARCHIVE_PATH bin etc - echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" - echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - - - name: Upload OR-Tools install artifact - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # 4.3.3 - with: - name: ${{ steps.metrix-install.outputs.archive_name }}.zip - path: ${{ steps.metrix-install.outputs.archive_path }}.zip - - - name: Upload asset to release - uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # 2.0.4 - if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') - with: - files: ${{ steps.metrix-install.outputs.archive_name }}.zip \ No newline at end of file diff --git a/.github/workflows/full-ci.yml b/.github/workflows/full-ci.yml index a2113e7e..ff606354 100644 --- a/.github/workflows/full-ci.yml +++ b/.github/workflows/full-ci.yml @@ -1,6 +1,7 @@ name: Full CI on: + workflow_dispatch: push: branches: - main diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index 4ca5c84f..3729a9a7 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -27,7 +27,7 @@ jobs: run: ./mvnw --batch-mode package - name: Upload release package - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 with: files: ./metrix-distribution/target/itools-metrix.zip @@ -116,7 +116,7 @@ jobs: echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - name: Upload release package - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 (nb: v0.1.15) with: files: ${{ steps.metrix-install.outputs.archive_path }}.zip @@ -165,7 +165,7 @@ jobs: echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - name: Upload release package - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 with: files: ${{ steps.metrix-install.outputs.archive_path }}.zip @@ -212,6 +212,6 @@ jobs: echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" - name: Upload release package - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 with: files: ${{ steps.metrix-install.outputs.archive_path }}.zip