From 3adc7df667fabe200be9d46e4b457ee55c533092 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Tue, 15 Oct 2024 19:49:32 +0200 Subject: [PATCH 01/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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/28] 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 4abfd5066c6e9868691dee64effb2894d2ba7513 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 9 Oct 2024 18:22:42 +0200 Subject: [PATCH 15/28] wip windows ci Signed-off-by: Damien Jeandemange --- .github/workflows/ci_windows.yml | 61 +++++++++++++++++++++++++++++ metrix-simulator/CMakeLists.txt | 7 +++- metrix-simulator/cmake/tnr.cmake | 3 +- metrix-simulator/log/src/logger.cpp | 4 ++ 4 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci_windows.yml diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml new file mode 100644 index 00000000..5e558d0c --- /dev/null +++ b/.github/workflows/ci_windows.yml @@ -0,0 +1,61 @@ +name: CI-cpp-windows + +on: + workflow_dispatch: {} + pull_request: + types: [opened, ready_for_review, reopened] + push: + paths: + - 'metrix-simulator/**' + - '.github/workflows/ci_windows.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: + windows: + env: + BOOST_ROOT: C:\thirdparties\boost-1.72.0 + BOOST_URL: https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe/download + name: Tests C++ Windows + runs-on: windows-latest + steps: + + - name: Install Boost + shell: cmd + run: | + wget -nv -O boost-installer.exe %BOOST_URL% + boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart + + - name: Checkout sources + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 + + - name: Configure 3rd parties + run: > + cmake -S %GITHUB_WORKSPACE%\metrix-simulator\external -B %GITHUB_WORKSPACE%\metrix-simulator\build-windows\external + + - name: Build 3rd parties + run: > + cmake --build %GITHUB_WORKSPACE%\metrix-simulator\build-windows\external --parallel 2 --config Release + + - name: Configure CMake + run: > + cmake -Wno-dev -S %GITHUB_WORKSPACE%\metrix-simulator -B %GITHUB_WORKSPACE%\metrix-simulator\build-windows + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\metrix-simulator\build-windows\install + + - name: Build + run: cmake --build %GITHUB_WORKSPACE%\metrix-simulator\build-windows --target install --parallel 2 --config Release + +# - name: Tests +# run: cd %GITHUB_WORKSPACE%\metrix-simulator\build-windows && ctest -j8 --output-on-failure -C Release diff --git a/metrix-simulator/CMakeLists.txt b/metrix-simulator/CMakeLists.txt index cf7487d2..af8f9cde 100755 --- a/metrix-simulator/CMakeLists.txt +++ b/metrix-simulator/CMakeLists.txt @@ -8,7 +8,7 @@ # SPDX-License-Identifier: MPL-2.0 # -cmake_minimum_required(VERSION 3.12 FATAL_ERROR) +cmake_minimum_required(VERSION 3.14 FATAL_ERROR) include(CMakePackageConfigHelpers) @@ -28,7 +28,8 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") set(INSTALL_CMAKE_DIR cmake CACHE PATH "Installation directory for cmake files") if(MSVC) - add_compile_definitions(WIN32) + add_definitions(-D_WIN32_WINNT=0x0A00) + add_compile_definitions("_CRT_SECURE_NO_WARNINGS") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:5000000 ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # In release, we prefer speed over size of the code @@ -46,6 +47,7 @@ endif(MSVC) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) +set(Boost_USE_STATIC_RUNTIME ON) find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options log filesystem) option(USE_SIRIUS_SHARED "Use shared library for sirius solver" OFF) @@ -142,6 +144,7 @@ target_link_libraries(${target} SuiteSparse::SuiteSparse_BTF SuiteSparse::SuiteSparse_Config ${Boost_LIBRARIES} + $<$:msvcrt.lib> ) if (USE_SIRIUS_SHARED) diff --git a/metrix-simulator/cmake/tnr.cmake b/metrix-simulator/cmake/tnr.cmake index 08bf7524..3c18886a 100644 --- a/metrix-simulator/cmake/tnr.cmake +++ b/metrix-simulator/cmake/tnr.cmake @@ -10,8 +10,7 @@ # function(check_file file expected_file) - configure_file(${file} ${file} NEWLINE_STYLE LF) # required for windows ctest - execute_process( COMMAND ${CMAKE_COMMAND} -E compare_files ${file} ${expected_file} + execute_process( COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${file} ${expected_file} RESULT_VARIABLE compare_result) if(compare_result) MESSAGE(FATAL_ERROR "File " ${file} " is different from expected file " ${expected_file}) diff --git a/metrix-simulator/log/src/logger.cpp b/metrix-simulator/log/src/logger.cpp index 854fb47a..835e0c86 100644 --- a/metrix-simulator/log/src/logger.cpp +++ b/metrix-simulator/log/src/logger.cpp @@ -17,6 +17,10 @@ #include #include +#if defined(_MSC_VER) +#define localtime_r(T,Tm) (localtime_s(Tm,T) ? NULL : Tm) +#endif + using namespace boost::log; namespace metrix From f97ab3fce0227051d057f2036a5facec199931a1 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 9 Oct 2024 18:40:58 +0200 Subject: [PATCH 16/28] wip windows ci Signed-off-by: Damien Jeandemange --- .github/workflows/ci_windows.yml | 2 ++ metrix-simulator/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 5e558d0c..416b7f42 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -34,6 +34,8 @@ jobs: - name: Install Boost shell: cmd run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + choco install wget --no-progress wget -nv -O boost-installer.exe %BOOST_URL% boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart diff --git a/metrix-simulator/CMakeLists.txt b/metrix-simulator/CMakeLists.txt index af8f9cde..5474e29c 100755 --- a/metrix-simulator/CMakeLists.txt +++ b/metrix-simulator/CMakeLists.txt @@ -35,6 +35,7 @@ if(MSVC) # In release, we prefer speed over size of the code set(CMAKE_CXX_FLAGS_RELEASE "/O2") set(CMAKE_C_FLAGS_RELEASE "/O2") + set(Boost_USE_STATIC_RUNTIME ON) else() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) @@ -47,7 +48,6 @@ endif(MSVC) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) -set(Boost_USE_STATIC_RUNTIME ON) find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options log filesystem) option(USE_SIRIUS_SHARED "Use shared library for sirius solver" OFF) From 75c3322066159f2ab79106e5c483cc11446765f4 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 9 Oct 2024 18:49:13 +0200 Subject: [PATCH 17/28] wip windows ci Signed-off-by: Damien Jeandemange --- .github/workflows/ci_windows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 416b7f42..9306a447 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -20,7 +20,7 @@ concurrency: defaults: run: - shell: bash + shell: cmd jobs: windows: @@ -32,7 +32,6 @@ jobs: steps: - name: Install Boost - shell: cmd run: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" choco install wget --no-progress From 8cec70eabfee3d6d2e643d5b718188c2159bd73b Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 9 Oct 2024 19:13:20 +0200 Subject: [PATCH 18/28] wip windows ci / cpp tests Signed-off-by: Damien Jeandemange --- .github/workflows/ci_windows.yml | 4 ++-- metrix-simulator/tests/variantes_regroupees/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 9306a447..c546a79e 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -58,5 +58,5 @@ jobs: - name: Build run: cmake --build %GITHUB_WORKSPACE%\metrix-simulator\build-windows --target install --parallel 2 --config Release -# - name: Tests -# run: cd %GITHUB_WORKSPACE%\metrix-simulator\build-windows && ctest -j8 --output-on-failure -C Release + - name: Tests + run: cd %GITHUB_WORKSPACE%\metrix-simulator\build-windows && ctest -j8 --output-on-failure -C Release diff --git a/metrix-simulator/tests/variantes_regroupees/CMakeLists.txt b/metrix-simulator/tests/variantes_regroupees/CMakeLists.txt index c76d72cf..c35c5de5 100644 --- a/metrix-simulator/tests/variantes_regroupees/CMakeLists.txt +++ b/metrix-simulator/tests/variantes_regroupees/CMakeLists.txt @@ -15,6 +15,6 @@ set(TEST_DIR ${MAIN_TEST_DIR}/${TEST_DIR_NAME}) set(EXPECTED_TEST_DIR ${MAIN_TEST_DIR}_reference/${TEST_DIR_NAME}) if(METRIX_RUN_ALL_TESTS) -metrix_test("variantes_regroupees_complexe" 11) # no check here because of random and equivalent solutions +metrix_test_no_check("variantes_regroupees_complexe" 11) # no check here because of random and equivalent solutions endif() metrix_test("variantes_regroupees_simple" 8) From d6c0adfdebb5a982372bd68d2e48c10a6fe8ecca Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Thu, 10 Oct 2024 06:31:46 +0200 Subject: [PATCH 19/28] test Signed-off-by: Damien Jeandemange --- .github/workflows/ci_windows.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index c546a79e..89c785cb 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -58,5 +58,22 @@ jobs: - name: Build run: cmake --build %GITHUB_WORKSPACE%\metrix-simulator\build-windows --target install --parallel 2 --config Release - - name: Tests - run: cd %GITHUB_WORKSPACE%\metrix-simulator\build-windows && ctest -j8 --output-on-failure -C Release +# - name: Tests +# run: cd %GITHUB_WORKSPACE%\metrix-simulator\build-windows && ctest -j2 --output-on-failure -C Release + + - name: Prepare Metrix install artifact + shell: bash + id: metrix-install + run: | + ARCHIVE_NAME="metrix-simulator-windows" + ARCHIVE_PATH="${GITHUB_WORKSPACE}/${ARCHIVE_NAME}" + cd $GITHUB_WORKSPACE/metrix-simulator/build-windows/install + zip -r $ARCHIVE_PATH bin etc + echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + + - name: Upload Metrix install artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.metrix-install.outputs.archive_name }}.zip + path: ${{ steps.metrix-install.outputs.archive_path }}.zip From a0ceeb4660874be65a76a1720c65de72da02c7da Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Thu, 10 Oct 2024 07:00:45 +0200 Subject: [PATCH 20/28] test Signed-off-by: Damien Jeandemange --- .github/workflows/ci_windows.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 89c785cb..ed3dc43c 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -62,18 +62,13 @@ jobs: # run: cd %GITHUB_WORKSPACE%\metrix-simulator\build-windows && ctest -j2 --output-on-failure -C Release - name: Prepare Metrix install artifact - shell: bash - id: metrix-install + shell: powershell run: | - ARCHIVE_NAME="metrix-simulator-windows" - ARCHIVE_PATH="${GITHUB_WORKSPACE}/${ARCHIVE_NAME}" - cd $GITHUB_WORKSPACE/metrix-simulator/build-windows/install - zip -r $ARCHIVE_PATH bin etc - echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_OUTPUT" - echo "archive_path=$ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + cd $env:GITHUB_WORKSPACE/metrix-simulator/build-windows/install + Compress-Archive -Path bin,etc -Destination $env:GITHUB_WORKSPACE/metrix-simulator-windows.zip - name: Upload Metrix 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: metrix-simulator-windows.zip + path: metrix-simulator-windows.zip From ce49058adb8ea93ee3c6e565cd582fae51212735 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Thu, 10 Oct 2024 07:35:00 +0200 Subject: [PATCH 21/28] test Signed-off-by: Damien Jeandemange --- .github/workflows/ci_windows.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index ed3dc43c..3a094151 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -61,14 +61,16 @@ jobs: # - name: Tests # run: cd %GITHUB_WORKSPACE%\metrix-simulator\build-windows && ctest -j2 --output-on-failure -C Release - - name: Prepare Metrix install artifact - shell: powershell - run: | - cd $env:GITHUB_WORKSPACE/metrix-simulator/build-windows/install - Compress-Archive -Path bin,etc -Destination $env:GITHUB_WORKSPACE/metrix-simulator-windows.zip +# - name: Prepare Metrix install artifact +# shell: powershell +# run: | +# cd $env:GITHUB_WORKSPACE/metrix-simulator/build-windows/install +# Compress-Archive -Path bin,etc -Destination $env:GITHUB_WORKSPACE/metrix-simulator-windows.zip - name: Upload Metrix install artifact uses: actions/upload-artifact@v3 with: - name: metrix-simulator-windows.zip - path: metrix-simulator-windows.zip + name: metrix-simulator-windows + path: | + metrix-simulator/build-windows/install/bin + metrix-simulator/build-windows/install/etc From bc9a44c1acc645d76ae1c88cd452ac6c04e0fc83 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Fri, 18 Oct 2024 16:39:25 +0200 Subject: [PATCH 22/28] wip Signed-off-by: Damien Jeandemange --- .github/workflows/ci_windows.yml | 76 -------------------------------- .github/workflows/dev-ci.yml | 49 ++++++++++++++++++++ .github/workflows/full-ci.yml | 40 +++++++++++++++++ .github/workflows/release-ci.yml | 69 +++++++++++++++++++++++++++++ 4 files changed, 158 insertions(+), 76 deletions(-) delete mode 100644 .github/workflows/ci_windows.yml diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml deleted file mode 100644 index 3a094151..00000000 --- a/.github/workflows/ci_windows.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: CI-cpp-windows - -on: - workflow_dispatch: {} - pull_request: - types: [opened, ready_for_review, reopened] - push: - paths: - - 'metrix-simulator/**' - - '.github/workflows/ci_windows.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: cmd - -jobs: - windows: - env: - BOOST_ROOT: C:\thirdparties\boost-1.72.0 - BOOST_URL: https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe/download - name: Tests C++ Windows - runs-on: windows-latest - steps: - - - name: Install Boost - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - choco install wget --no-progress - wget -nv -O boost-installer.exe %BOOST_URL% - boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart - - - name: Checkout sources - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 - - - name: Configure 3rd parties - run: > - cmake -S %GITHUB_WORKSPACE%\metrix-simulator\external -B %GITHUB_WORKSPACE%\metrix-simulator\build-windows\external - - - name: Build 3rd parties - run: > - cmake --build %GITHUB_WORKSPACE%\metrix-simulator\build-windows\external --parallel 2 --config Release - - - name: Configure CMake - run: > - cmake -Wno-dev -S %GITHUB_WORKSPACE%\metrix-simulator -B %GITHUB_WORKSPACE%\metrix-simulator\build-windows - -DCMAKE_BUILD_TYPE=Release - -DCMAKE_INSTALL_PREFIX=%GITHUB_WORKSPACE%\metrix-simulator\build-windows\install - - - name: Build - run: cmake --build %GITHUB_WORKSPACE%\metrix-simulator\build-windows --target install --parallel 2 --config Release - -# - name: Tests -# run: cd %GITHUB_WORKSPACE%\metrix-simulator\build-windows && ctest -j2 --output-on-failure -C Release - -# - name: Prepare Metrix install artifact -# shell: powershell -# run: | -# cd $env:GITHUB_WORKSPACE/metrix-simulator/build-windows/install -# Compress-Archive -Path bin,etc -Destination $env:GITHUB_WORKSPACE/metrix-simulator-windows.zip - - - name: Upload Metrix install artifact - uses: actions/upload-artifact@v3 - with: - name: metrix-simulator-windows - path: | - metrix-simulator/build-windows/install/bin - metrix-simulator/build-windows/install/etc diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index e96cde98..32900025 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -239,6 +239,55 @@ jobs: metrix-simulator/build/install/bin metrix-simulator/build/install/etc + cpp_windows: + name: Build C++ Windows + runs-on: windows-latest + defaults: + run: + shell: cmd + env: + BOOST_ROOT: C:\thirdparties\boost-1.72.0 + BOOST_URL: https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe/download + steps: + - name: Install Boost + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + choco install wget --no-progress + wget -nv -O boost-installer.exe %BOOST_URL% + boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart + + - name: Checkout sources + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 + + - 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 --config Release + + - 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 --config Release + + - name: Tests + run: cd %GITHUB_WORKSPACE%\metrix-simulator\build && ctest -j2 --output-on-failure -C Release + + - name: Upload Metrix Simulator archive + if: ${{ github.event_name == 'workflow_dispatch' && inputs.generate_artifacts }} + uses: actions/upload-artifact@v3 + with: + name: metrix-simulator-windows + path: | + metrix-simulator/build/install/bin + metrix-simulator/build/install/etc + cpp_ubuntu_qa: name: Short QA C++ Ubuntu runs-on: ubuntu-latest diff --git a/.github/workflows/full-ci.yml b/.github/workflows/full-ci.yml index a2113e7e..0fce2848 100644 --- a/.github/workflows/full-ci.yml +++ b/.github/workflows/full-ci.yml @@ -200,6 +200,46 @@ jobs: - name: Tests run: cd $GITHUB_WORKSPACE/metrix-simulator/build && ctest -j2 --output-on-failure + cpp_windows: + name: Build C++ Windows + runs-on: windows-latest + defaults: + run: + shell: cmd + env: + BOOST_ROOT: C:\thirdparties\boost-1.72.0 + BOOST_URL: https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe/download + steps: + - name: Install Boost + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + choco install wget --no-progress + wget -nv -O boost-installer.exe %BOOST_URL% + boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart + + - name: Checkout sources + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 + + - 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 --config Release + + - 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 --config Release + + - name: Tests + run: cd %GITHUB_WORKSPACE%\metrix-simulator\build && ctest -j2 --output-on-failure -C Release + cpp_ubuntu_qa: name: Full QA C++ Ubuntu runs-on: ubuntu-latest diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index f09ee1cf..deadfa05 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -238,3 +238,72 @@ jobs: asset_path: ${{ steps.metrix-install.outputs.archive_path }}.zip asset_name: ${{ steps.metrix-install.outputs.archive_name }}.zip asset_content_type: application/zip + + cpp_windows: + name: Package C++ Windows + runs-on: windows-latest + defaults: + run: + shell: cmd + env: + BOOST_ROOT: C:\thirdparties\boost-1.72.0 + BOOST_URL: https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe/download + steps: + - name: Install Boost + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + choco install wget --no-progress + wget -nv -O boost-installer.exe %BOOST_URL% + boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart + + - name: Checkout sources + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 + + - 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 --config Release + + - 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 --config Release + + - name: Tests + run: cd %GITHUB_WORKSPACE%\metrix-simulator\build && ctest -j2 --output-on-failure -C Release + + - name: Prepare Metrix package + id: metrix-install + shell: bash + run: | + ARCHIVE_NAME="metrix-simulator-windows" + ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" + cd metrix-simulator/build/install/ + zip -r $ARCHIVE_PATH bin etc + + - name: Prepare Metrix package + shell: powershell + run: | + $env:ARCHIVE_NAME = "metrix-simulator-windows" + $env:ARCHIVE_PATH = "$env:GITHUB_WORKSPACE\$env:ARCHIVE_NAME" + cd $env:GITHUB_WORKSPACE/metrix-simulator/build/install + Compress-Archive -Path bin,etc -Destination $env:ARCHIVE_PATH + echo "archive_name=$env:ARCHIVE_NAME" >> "$GITHUB_OUTPUT" + echo "archive_path=$env: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 \ No newline at end of file From 8a262295f569e526e425a6f8d722cd598bff4661 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Mon, 28 Oct 2024 16:58:46 +0100 Subject: [PATCH 23/28] fix Signed-off-by: Damien Jeandemange --- .github/workflows/release-ci.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index deadfa05..8a1ec64b 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -279,15 +279,6 @@ jobs: - name: Tests run: cd %GITHUB_WORKSPACE%\metrix-simulator\build && ctest -j2 --output-on-failure -C Release - - name: Prepare Metrix package - id: metrix-install - shell: bash - run: | - ARCHIVE_NAME="metrix-simulator-windows" - ARCHIVE_PATH="$PWD/${ARCHIVE_NAME}" - cd metrix-simulator/build/install/ - zip -r $ARCHIVE_PATH bin etc - - name: Prepare Metrix package shell: powershell run: | @@ -306,4 +297,4 @@ jobs: 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 \ No newline at end of file + asset_content_type: application/zip From ca29d53aff1cbefadb7eddfdaeec9a783e926f6b Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Mon, 28 Oct 2024 17:37:08 +0100 Subject: [PATCH 24/28] fix Signed-off-by: Damien Jeandemange --- .github/workflows/release-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index 8a1ec64b..e365ae74 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -280,6 +280,7 @@ jobs: run: cd %GITHUB_WORKSPACE%\metrix-simulator\build && ctest -j2 --output-on-failure -C Release - name: Prepare Metrix package + id: metrix-install shell: powershell run: | $env:ARCHIVE_NAME = "metrix-simulator-windows" From 766fc14d15c6e7ba4fcb7492497717c83c920315 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Mon, 28 Oct 2024 21:40:39 +0100 Subject: [PATCH 25/28] 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 e365ae74..938dd101 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -287,8 +287,8 @@ jobs: $env:ARCHIVE_PATH = "$env:GITHUB_WORKSPACE\$env:ARCHIVE_NAME" cd $env:GITHUB_WORKSPACE/metrix-simulator/build/install Compress-Archive -Path bin,etc -Destination $env:ARCHIVE_PATH - echo "archive_name=$env:ARCHIVE_NAME" >> "$GITHUB_OUTPUT" - echo "archive_path=$env:ARCHIVE_PATH" >> "$GITHUB_OUTPUT" + echo "archive_name=$env:ARCHIVE_NAME" >> "$env:GITHUB_OUTPUT" + echo "archive_path=$env:ARCHIVE_PATH" >> "$env:GITHUB_OUTPUT" - name: Upload release package uses: actions/upload-release-asset@v1.0.1 From 82bb2fb09f3497547c074d40321414e2980812a8 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 6 Nov 2024 14:18:10 +0100 Subject: [PATCH 26/28] 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 bb3f3c00eb5139b9a0409d8b84d78d87eb0eeb22 Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 6 Nov 2024 14:26:01 +0100 Subject: [PATCH 27/28] use softprops/action-gh-release Signed-off-by: Damien Jeandemange --- .github/workflows/release-ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-ci.yml b/.github/workflows/release-ci.yml index 46f97845..df6c9baa 100644 --- a/.github/workflows/release-ci.yml +++ b/.github/workflows/release-ci.yml @@ -262,17 +262,13 @@ jobs: run: | $env:ARCHIVE_NAME = "metrix-simulator-windows" $env:ARCHIVE_PATH = "$env:GITHUB_WORKSPACE\$env:ARCHIVE_NAME" + $env:ARCHIVE_PATH = $env:ARCHIVE_PATH -replace '\\','/' cd $env:GITHUB_WORKSPACE/metrix-simulator/build/install Compress-Archive -Path bin,etc -Destination $env:ARCHIVE_PATH echo "archive_name=$env:ARCHIVE_NAME" >> "$env:GITHUB_OUTPUT" echo "archive_path=$env:ARCHIVE_PATH" >> "$env: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 f1ea70943efccbc3f0a5c5e6bc9ef5da9d2fc86e Mon Sep 17 00:00:00 2001 From: Damien Jeandemange Date: Wed, 6 Nov 2024 14:45:09 +0100 Subject: [PATCH 28/28] update readme for cmake 3.14 Signed-off-by: Damien Jeandemange --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 063f8780..e563ca63 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ all input options are described in --help option To build metrix-simulator, you need: - A C++ compiler that supports C++11 ([clang](https://clang.llvm.org) 3.3 or higher, [g++](https://gcc.gnu.org) 5.0 or higher) -- [CMake](https://cmake.org) (3.12 or higher) +- [CMake](https://cmake.org) (3.14 or higher) - [Make](https://www.gnu.org/software/make/) - [Boost](https://www.boost.org) development packages (1.66 or higher) @@ -200,9 +200,9 @@ $> apt install -y g++ git libboost-all-dev libxml2-dev make wget **Note:** Under Ubuntu 18.04, the default CMake package is too old (3.10), so you have to install it manually: ``` -$> wget https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.tar.gz -$> tar xzf cmake-3.12.0-Linux-x86_64.tar.gz -$> export PATH=$PWD/cmake-3.12.0-Linux-x86_64/bin:$PATH +$> wget https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz +$> tar xzf cmake-3.14.0-Linux-x86_64.tar.gz +$> export PATH=$PWD/cmake-3.14.0-Linux-x86_64/bin:$PATH ``` ###### CentOS 8 @@ -212,9 +212,9 @@ $> yum install -y boost-devel gcc-c++ git libxml2-devel make wget **Note:** Under CentOS 8, the default CMake package is too old (3.11.4), so you have to install it manually: ``` -$> wget https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.tar.gz -$> tar xzf cmake-3.12.0-Linux-x86_64.tar.gz -$> export PATH=$PWD/cmake-3.12.0-Linux-x86_64/bin:$PATH +$> wget https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz +$> tar xzf cmake-3.14.0-Linux-x86_64.tar.gz +$> export PATH=$PWD/cmake-3.14.0-Linux-x86_64/bin:$PATH ``` ###### CentOS 7 @@ -231,9 +231,9 @@ $> export BOOST_LIBRARYDIR=/usr/lib64/boost166 **Note:** Under CentOS 7, the default CMake package is too old (2.8.12), so you have to install it manually: ``` -$> wget https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.tar.gz -$> tar xzf cmake-3.12.0-Linux-x86_64.tar.gz -$> export PATH=$PWD/cmake-3.12.0-Linux-x86_64/bin:$PATH +$> wget https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz +$> tar xzf cmake-3.14.0-Linux-x86_64.tar.gz +$> export PATH=$PWD/cmake-3.14.0-Linux-x86_64/bin:$PATH ``` ##### Build sources