Skip to content

Commit 19c47ab

Browse files
committed
refactoring the github workflow to pick up test coverage
1 parent ab19cfb commit 19c47ab

File tree

67 files changed

+41668
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+41668
-6
lines changed

.github/workflows/cpp_coverage.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PROFILE_DIR=$(ls -t /tmp/Build/ProfileData | head -n 1);
2+
xcrun llvm-cov show \
3+
/tmp/Build/Products/Debug/tests.xctest/Contents/MacOS/tests \
4+
-instr-profile="/tmp/Build/ProfileData/${PROFILE_DIR}/Coverage.profdata" \
5+
-format=text \
6+
> coverage.txt

.github/workflows/sonarcloud.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,24 @@ jobs:
5858
-destination 'platform=macOS'
5959
-resultBundlePath TestResult/
6060
-enableCodeCoverage YES
61-
-derivedDataPath "${RUNNER_TEMP}/Build/DerivedData"
61+
-derivedDataPath "/tmp"
6262
HEADER_SEARCH_PATHS="./external/libpqxx/include/pqxx/internal ./external/libpqxx/include/ ./external/libpqxx/build/include/ ./external/" \
6363
LIBRARY_SEARCH_PATHS="./external/libpqxx/src/ ./external/libpqxx/build/src/" \
6464
OTHER_LDFLAGS="-L./external/libpqxx/build/src -lpqxx -lpq -L/opt/homebrew/Cellar/pkgconf/2.3.0_1/lib -L/opt/homebrew/Cellar/pkgconf/2.3.0_1/lib/pkgconfig -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14 -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14/pgxs -L/opt/homebrew/Cellar/postgresql@14/14.15/lib/postgresql@14/pkgconfig"
6565
clean build test
6666
| xcpretty -r junit && exit ${PIPESTATUS[0]}
67-
- name: Convert coverage report to sonarqube format
68-
run: >
69-
bash ./.github/workflows/xccov-to-sonarqube-generic.sh *.xcresult/ > sonarqube-generic-coverage.xml
67+
- name: Check artifacts
68+
run: |
69+
sh ./.github/workflows/cpp_coverage.sh
70+
# - name: Convert coverage report to sonarqube format
71+
# run: >
72+
# bash ./.github/workflows/xccov-to-sonarqube-generic.sh *.xcresult/ > sonarqube-generic-coverage.xml
7073
# Artifact will be available only for 1 day, this is because
7174
# it's only used to pass test data to SonarCloud only
7275
- name: Upload coverage report
7376
uses: actions/upload-artifact@v4
7477
with:
75-
path: sonarqube-generic-coverage.xml
78+
path: coverage.txt
7679
retention-days: 1
7780

7881
# This block takes the artifact generated from the build step and uses it for SonarCloud analysis
@@ -139,4 +142,5 @@ jobs:
139142
with:
140143
args: >
141144
-Dsonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json
142-
-Dsonar.coverageReportPaths=artifact/sonarqube-generic-coverage.xml
145+
-Dsonar.sonar.cfamily.gcov.reportsPath=artifact/coverage.txt
146+
# -Dsonar.coverageReportPaths=artifact/sonarqube-generic-coverage.xml

0 commit comments

Comments
 (0)