diff --git a/.deepsource.toml b/.deepsource.toml index e4f66304..c70937d3 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -8,9 +8,6 @@ exclude_patterns = [ "tests/**" ] -[[analyzers]] -name = "test-coverage" - [[analyzers]] name = "shell" @@ -36,3 +33,7 @@ name = "docker" [[analyzers]] name = "cxx" + [analyzers.meta] + misra_compliance = true + cyclomatic_complexity_threshold = "very-high" + diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 676ff34d..48cbc464 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -28,6 +28,7 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + ref: ${{ github.event.pull_request.head.sha }} - name: Fix Dubious Ownership run: git config --global --add safe.directory /opt/Autonomy_Software @@ -42,10 +43,10 @@ jobs: cd /opt/Autonomy_Software/ git fetch --force --recurse-submodules branch=${{ steps.extract_branch.outputs.branch }} - echo $branch - git reset --hard origin/$branch - git checkout $branch - git pull --ff-only + echo ${{ github.event.pull_request.head.sha }} + git reset --hard ${{ github.event.pull_request.head.sha }} + git checkout ${{ github.event.pull_request.head.sha }} + # git pull --ff-only git submodule update --force --recursive --init git config --global --add safe.directory /opt/Autonomy_Software/external @@ -64,6 +65,15 @@ jobs: ctest --output-on-failure -T Test -T Coverage ctest --output-on-failure --output-junit Test.xml gcovr --root . --xml-pretty --output Coverage.xml + lcov -c -d . -o coverage.info + + - name: Upload coverage to deepsource + run: | + cd /opt/Autonomy_Software/build + curl https://deepsource.io/cli | sh + ./bin/deepsource report --analyzer test-coverage --key cxx --value-file ./coverage.info + env: + DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} - name: Upload coverage to Codecov uses: codecov/codecov-action@v4