From 578ba3cbd1bf439e98418048b70fc899758fb4e7 Mon Sep 17 00:00:00 2001 From: Florian Dupuy <66690739+flo-dup@users.noreply.github.com> Date: Wed, 24 Jul 2024 16:52:36 +0200 Subject: [PATCH] Fix CI (#453) * MacOs Tieline unit tests reference fixes iidm v1.0, v1.1, v1.2, v1.3, v1.4 * Use java 17 in QA CI * Use sonarcloud-github-c-cpp gh action in QA CI * Use latest actions versions in CI * Remove sonar.cfamily.build-wrapper-output property Signed-off-by: Florian Dupuy (cherry picked from commit 77dfcf74d3044e9b21398a61e7c62005e8a68b4a) --- .github/workflows/ci.yml | 57 +++++++------------ sonar-project.properties | 1 - test/resources/V1_0/tieline.xml.macos | 4 +- .../V1_0/tielineFictitious.xml.macos | 4 +- .../V1_0/tl-loading-limits.xml.macos | 4 +- test/resources/V1_1/tieline.xml.macos | 4 +- .../V1_1/tielineFictitious.xml.macos | 4 +- .../V1_1/tl-loading-limits.xml.macos | 4 +- test/resources/V1_2/tieline.xml.macos | 4 +- .../V1_2/tielineFictitious.xml.macos | 4 +- .../V1_2/tl-loading-limits.xml.macos | 4 +- test/resources/V1_3/tieline.xml.macos | 4 +- .../V1_3/tielineFictitious.xml.macos | 4 +- .../V1_3/tielineWithAliases.xml.macos | 4 +- .../V1_3/tl-loading-limits.xml.macos | 4 +- test/resources/V1_4/tieline.xml.macos | 4 +- .../V1_4/tielineFictitious.xml.macos | 4 +- .../V1_4/tielineWithAliases.xml.macos | 4 +- .../V1_4/tl-loading-limits.xml.macos | 4 +- 19 files changed, 53 insertions(+), 73 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 061bab316..1d3f7a66b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: sudo apt-get install -y libboost-all-dev - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 - name: Configure CMake run: > @@ -53,7 +53,7 @@ jobs: run: brew install boost - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 - name: Configure CMake run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build-macos -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON @@ -94,7 +94,7 @@ jobs: boost-installer.exe /dir=%BOOST_ROOT% /sp- /verysilent /suppressmsgboxes /norestart - name: Checkout sources - uses: actions/checkout@v1 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 - name: Configure CMake shell: cmd @@ -119,53 +119,35 @@ jobs: qa: name: QA runs-on: ubuntu-latest + env: + BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed steps: - - name: Install Java 11 - uses: actions/setup-java@v1 + - name: Install Java 17 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: - java-version: 11 + 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@v1 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6 - - name: Configure CMake - run: > - cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build - -DCMAKE_BUILD_TYPE=Debug - -DCODE_COVERAGE=TRUE - -DBUILD_EXAMPLES=ON + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@816b1822d71776ee0d32bc012e95024ec52ac1fc # v3.1.0 - name: Build - run: > - ${{ runner.workspace }}/build-wrapper-linux-x86/build-wrapper-linux-x86-64 - --out-dir $GITHUB_WORKSPACE/build/output - cmake --build $GITHUB_WORKSPACE/build --parallel 2 + run: | + cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=TRUE -DBUILD_EXAMPLES=ON + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build $GITHUB_WORKSPACE/build --parallel 2 - name: Tests run: > @@ -177,10 +159,9 @@ jobs: run: cmake --build $GITHUB_WORKSPACE/build --target code-coverage - name: Sonarcloud - working-directory: ${{ runner.workspace }}/powsybl-iidm4cpp env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: > - ${{ runner.workspace }}/sonar/bin/sonar-scanner - -Dsonar.host.url=https://sonarcloud.io + run: | + sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" + diff --git a/sonar-project.properties b/sonar-project.properties index 024ab352f..8385f5fe2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -14,6 +14,5 @@ sonar.cxx.includedirectories=include,extensions/entsoe/include,extensions/iidm/i sonar.sources=src,include,extensions/entsoe/src,extensions/entsoe/include,extensions/iidm/src,extensions/iidm/include,extensions/sld/src,extensions/sld/include sonar.tests=test,extensions/entsoe/test,extensions/iidm/test,extensions/sld/test -sonar.cfamily.build-wrapper-output=build/output sonar.coverageReportPaths=build/coverage/coverage.xml sonar.cfamily.threads=2 diff --git a/test/resources/V1_0/tieline.xml.macos b/test/resources/V1_0/tieline.xml.macos index aff805d47..4220c38d3 100644 --- a/test/resources/V1_0/tieline.xml.macos +++ b/test/resources/V1_0/tieline.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_0/tielineFictitious.xml.macos b/test/resources/V1_0/tielineFictitious.xml.macos index aff805d47..4220c38d3 100644 --- a/test/resources/V1_0/tielineFictitious.xml.macos +++ b/test/resources/V1_0/tielineFictitious.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_0/tl-loading-limits.xml.macos b/test/resources/V1_0/tl-loading-limits.xml.macos index 04b334e30..e25688be1 100644 --- a/test/resources/V1_0/tl-loading-limits.xml.macos +++ b/test/resources/V1_0/tl-loading-limits.xml.macos @@ -37,7 +37,7 @@ - + @@ -47,5 +47,5 @@ - + diff --git a/test/resources/V1_1/tieline.xml.macos b/test/resources/V1_1/tieline.xml.macos index 62ff4667b..32f63b708 100644 --- a/test/resources/V1_1/tieline.xml.macos +++ b/test/resources/V1_1/tieline.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_1/tielineFictitious.xml.macos b/test/resources/V1_1/tielineFictitious.xml.macos index 62ff4667b..32f63b708 100644 --- a/test/resources/V1_1/tielineFictitious.xml.macos +++ b/test/resources/V1_1/tielineFictitious.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_1/tl-loading-limits.xml.macos b/test/resources/V1_1/tl-loading-limits.xml.macos index 2c32e3cab..e2cd98736 100644 --- a/test/resources/V1_1/tl-loading-limits.xml.macos +++ b/test/resources/V1_1/tl-loading-limits.xml.macos @@ -37,7 +37,7 @@ - + @@ -47,5 +47,5 @@ - + diff --git a/test/resources/V1_2/tieline.xml.macos b/test/resources/V1_2/tieline.xml.macos index c45ed8509..9216c9c88 100644 --- a/test/resources/V1_2/tieline.xml.macos +++ b/test/resources/V1_2/tieline.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_2/tielineFictitious.xml.macos b/test/resources/V1_2/tielineFictitious.xml.macos index c45ed8509..9216c9c88 100644 --- a/test/resources/V1_2/tielineFictitious.xml.macos +++ b/test/resources/V1_2/tielineFictitious.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_2/tl-loading-limits.xml.macos b/test/resources/V1_2/tl-loading-limits.xml.macos index 23d77660c..dc461be88 100644 --- a/test/resources/V1_2/tl-loading-limits.xml.macos +++ b/test/resources/V1_2/tl-loading-limits.xml.macos @@ -37,7 +37,7 @@ - + @@ -47,5 +47,5 @@ - + diff --git a/test/resources/V1_3/tieline.xml.macos b/test/resources/V1_3/tieline.xml.macos index a51574e28..627739bef 100644 --- a/test/resources/V1_3/tieline.xml.macos +++ b/test/resources/V1_3/tieline.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_3/tielineFictitious.xml.macos b/test/resources/V1_3/tielineFictitious.xml.macos index a51574e28..627739bef 100644 --- a/test/resources/V1_3/tielineFictitious.xml.macos +++ b/test/resources/V1_3/tielineFictitious.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_3/tielineWithAliases.xml.macos b/test/resources/V1_3/tielineWithAliases.xml.macos index 645c01fee..b15a276ba 100644 --- a/test/resources/V1_3/tielineWithAliases.xml.macos +++ b/test/resources/V1_3/tielineWithAliases.xml.macos @@ -37,9 +37,9 @@ - + Alias Other alias - + diff --git a/test/resources/V1_3/tl-loading-limits.xml.macos b/test/resources/V1_3/tl-loading-limits.xml.macos index 1a1bb9f17..166e6205d 100644 --- a/test/resources/V1_3/tl-loading-limits.xml.macos +++ b/test/resources/V1_3/tl-loading-limits.xml.macos @@ -37,7 +37,7 @@ - + @@ -47,5 +47,5 @@ - + diff --git a/test/resources/V1_4/tieline.xml.macos b/test/resources/V1_4/tieline.xml.macos index 231f3fc4d..84197cc4d 100644 --- a/test/resources/V1_4/tieline.xml.macos +++ b/test/resources/V1_4/tieline.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_4/tielineFictitious.xml.macos b/test/resources/V1_4/tielineFictitious.xml.macos index 231f3fc4d..84197cc4d 100644 --- a/test/resources/V1_4/tielineFictitious.xml.macos +++ b/test/resources/V1_4/tielineFictitious.xml.macos @@ -37,6 +37,6 @@ - - + + diff --git a/test/resources/V1_4/tielineWithAliases.xml.macos b/test/resources/V1_4/tielineWithAliases.xml.macos index 9c641d6ca..53a6ad37a 100644 --- a/test/resources/V1_4/tielineWithAliases.xml.macos +++ b/test/resources/V1_4/tielineWithAliases.xml.macos @@ -37,9 +37,9 @@ - + Alias Other alias - + diff --git a/test/resources/V1_4/tl-loading-limits.xml.macos b/test/resources/V1_4/tl-loading-limits.xml.macos index a82e79fe1..3fcbdc23c 100644 --- a/test/resources/V1_4/tl-loading-limits.xml.macos +++ b/test/resources/V1_4/tl-loading-limits.xml.macos @@ -37,7 +37,7 @@ - + @@ -47,5 +47,5 @@ - +