Update coverity_scan.yml #1459
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: Coverity scan | |
| on: [push, pull_request] | |
| jobs: | |
| coverity: | |
| name: Run Coverity tests | |
| if: contains(github.repository, 'martenrebane/MOPP-Android') && contains(github.ref, 'coverity_scan') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup environment | |
| env: | |
| GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
| run: | | |
| cd ${{ github.workspace }}/app | |
| echo -n "$GOOGLE_SERVICES_JSON" | base64 --decode > "google-services.json" | |
| cd ${{ github.workspace }} | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| - name: Install Coverity Scan Tool | |
| run: | | |
| curl https://scan.coverity.com/download/java/linux64 \ | |
| --output coverity_tool.tar.gz \ | |
| --data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=martenrebane/MOPP-Android" | |
| mkdir coverity-tool | |
| tar -xzf coverity_tool.tar.gz --strip 1 -C coverity-tool | |
| export PATH="${PWD}/coverity-tool/bin:${PATH}" | |
| - name: Build and analyze | |
| run: | | |
| cov-build --dir cov-int ./gradlew clean --no-daemon fetchAndPackageDefaultConfiguration assemble --quiet | |
| - name: Package results | |
| run: tar czvf coverity_results.tgz cov-int | |
| - name: Upload to Coverity Scan | |
| run: | | |
| curl \ | |
| --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \ | |
| --form email=marten.rebane@nortal.com \ | |
| --form file=@coverity_results.tgz \ | |
| --form version="${{ github.sha }}" \ | |
| --form description="${{ github.repository }}" \ | |
| https://scan.coverity.com/builds?project=martenrebane/MOPP-Android | |
| #- name: Build and send to Coverity | |
| # continue-on-error: true | |
| # run: | | |
| # export TRAVIS_BRANCH=${GITHUB_REF##*/} | |
| # wget https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh | |
| # chmod +x travisci_build_coverity_scan.sh | |
| # bash travisci_build_coverity_scan.sh | |
| # env: | |
| # COVERITY_SCAN_PROJECT_NAME: 'martenrebane/MOPP-Android' | |
| # COVERITY_SCAN_NOTIFICATION_EMAIL: 'marten.rebane@nortal.com' | |
| # COVERITY_SCAN_BRANCH_PATTERN: 'coverity_scan' | |
| # COVERITY_SCAN_BUILD_COMMAND: './gradlew clean --no-daemon fetchAndPackageDefaultConfiguration assemble --debug --stacktrace' | |
| # COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} |