|
| 1 | +name: Coverity Scan |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [coverity_scan] |
| 6 | + |
| 7 | +jobs: |
| 8 | + coverity: |
| 9 | + if: github.repository == 'web-eid/web-eid-authtoken-validation-php' |
| 10 | + runs-on: ubuntu-latest |
| 11 | + env: |
| 12 | + TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} |
| 13 | + PROJECTNAME: 'web-eid/web-eid-authtoken-validation-php' |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v5 |
| 16 | + #- uses: vapier/coverity-scan-action@v1 |
| 17 | + # with: |
| 18 | + # command: find . -name "*.php" |
| 19 | + |
| 20 | + # token: ${{ secrets.COVERITY_SCAN_TOKEN }} |
| 21 | + - name: Download Coverity Build Tool |
| 22 | + run: | |
| 23 | + curl --silent --data "token=$TOKEN&project=$PROJECTNAME" -o cov-analysis-linux64.tar.gz https://scan.coverity.com/download/cxx/linux64 |
| 24 | + mkdir cov-analysis-linux64 |
| 25 | + tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 |
| 26 | +
|
| 27 | + - name: Build |
| 28 | + run: | |
| 29 | + export PATH=$PWD/cov-analysis-linux64/bin:$PATH |
| 30 | + coverity capture --dir cov-int --project-dir . --file-include-regex '(^|/)(src|lib)/.*\.(php)$' --file-exclude-regex '(^|/)(vendor|dist|build)(/|$)' |
| 31 | + coverity analyze --dir cov-int --project-dir . |
| 32 | +
|
| 33 | + # cov-build --dir cov-int --no-command --fs-capture-search ./src |
| 34 | + |
| 35 | + #- name: Submit the result to Coverity Scan |
| 36 | + # run: | |
| 37 | + # tar czvf upload.tgz cov-int |
| 38 | + # curl --silent \ |
| 39 | + # --form project=$PROJECTNAME \ |
| 40 | + # --form token=$TOKEN \ |
| 41 | + |
| 42 | + |
| 43 | + # --form version=master \ |
| 44 | + # --form description="Github Actions CI build" \ |
| 45 | + # https://scan.coverity.com/builds?project=$PROJECTNAME |
| 46 | + |
| 47 | + - name: Archive artifacts |
| 48 | + uses: actions/upload-artifact@v5 |
| 49 | + with: |
| 50 | + name: logs |
| 51 | + path: cov-int/build-log.txt |
0 commit comments