tests: more tests for InAppMessagesManager and LocationManager #1327
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test SDK | |
| on: | |
| pull_request: | |
| branches: "**" | |
| env: | |
| DIFF_COVERAGE_THRESHOLD: '80' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: "[Checkout] Repo" | |
| uses: actions/checkout@v4 | |
| - name: "[Setup] Project" | |
| uses: ./.github/actions/project-setup | |
| - name: "[Code Formatting] Spotless" | |
| working-directory: OneSignalSDK | |
| run: | | |
| ./gradlew spotlessCheck --console=plain | |
| - name: "[Static Code Analysis] Detekt" | |
| working-directory: OneSignalSDK | |
| run: | | |
| ./gradlew detekt --console=plain | |
| - name: "[Test] SDK Unit Tests" | |
| working-directory: OneSignalSDK | |
| run: | | |
| ./gradlew testReleaseUnitTest --console=plain --continue | |
| - name: "[Coverage] Generate JaCoCo merged XML" | |
| working-directory: OneSignalSDK | |
| run: | | |
| ./gradlew jacocoTestReportAll jacocoMergedReport --console=plain --continue | |
| - name: "[Setup] Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: "[Diff Coverage] Install diff-cover" | |
| run: | | |
| python -m pip install --upgrade pip diff-cover | |
| - name: "[Diff Coverage] Check and HTML report" | |
| working-directory: OneSignalSDK | |
| run: | | |
| REPORT=build/reports/jacoco/merged/jacocoMergedReport.xml | |
| test -f "$REPORT" || { echo "Merged JaCoCo report not found at $REPORT" >&2; exit 1; } | |
| python -m diff_cover.diff_cover_tool "$REPORT" \ | |
| --compare-branch=origin/main \ | |
| --fail-under=$DIFF_COVERAGE_THRESHOLD | |
| python -m diff_cover.diff_cover_tool "$REPORT" \ | |
| --compare-branch=origin/main \ | |
| --html-report diff_coverage.html || true | |
| - name: Upload diff coverage HTML | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: diff-coverage-report | |
| path: OneSignalSDK/diff_coverage.html | |
| - name: Unit tests results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: unit-tests-results | |
| path: OneSignalSDK/unittest/build |