Skip to content

Commit

Permalink
CI : Add Report.CI
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslepoix committed Oct 14, 2022
1 parent 20151f6 commit 17d9c27
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion .github/workflows/test_sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
run: |
sudo apt update
sudo apt install -y \
gcovr
gcovr \
libxml2-utils
- name: "Dependencies: Sonar"
run: |
Expand All @@ -39,6 +40,18 @@ jobs:
-o /tmp/sonar/build-wrapper-linux-x86.zip \
-d /tmp/sonar/
- name: "Dependencies: Report.CI"
run: |
curl https://report.ci/report.py \
> /tmp/report.py
sed \
-i /tmp/report.py \
-e '459a\ "job" : env.get("GITHUB_JOB"),'
sed \
-i /tmp/report.py \
-e '459a\ "job-name" : env.get("GITHUB_JOB"),'
cat /tmp/report.py
- name: "Dependencies: Catch2"
run: |
git clone https://github.com/catchorg/Catch2.git
Expand Down Expand Up @@ -78,3 +91,35 @@ jobs:
-Dsonar.host.url="https://sonarcloud.io" \
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
-Dsonar.cfamily.cache.enabled=false
- name: Produce test report
run: |
build/test/unit/openemsh_unittest \
-r xml::out=build/test/unit/openemsh_unittest_result.catch.xml \
|| true
- name: Downgrade Catch XML format
run: |
sed \
-i build/test/unit/openemsh_unittest_result.catch.xml \
-e 's/<Catch2TestRun/<Catch/g' \
-e '3i\<Group name="openemsh_unittest">' \
-e "s/^<\/Catch2TestRun>/<\/Group>/"
cat build/test/unit/openemsh_unittest_result.catch.xml \
| tail -3 \
| head -1 \
>> build/test/unit/openemsh_unittest_result.catch.xml
sed \
-i build/test/unit/openemsh_unittest_result.catch.xml \
-e '$a\</Catch>'
xmllint \
build/test/unit/openemsh_unittest_result.catch.xml \
-o build/test/unit/openemsh_unittest_result.catch.xml \
--format
- name: Export test report
run: |
python /tmp/report.py \
--name "Unittest"
--token ${{ secrets.REPORT_CI_TOKEN }} \
--include-as-catch build/test/unit/*.catch.xml

0 comments on commit 17d9c27

Please sign in to comment.