| 1 | name: Coverity Scan |
| 2 | on: |
| 3 | push: |
| 4 | branches: [ coverity ] |
| 5 | workflow_dispatch: |
| 6 | jobs: |
| 7 | build: |
| 8 | runs-on: ubuntu-22.04 |
| 9 | steps: |
| 10 | - uses: actions/checkout@v3 |
| 11 | with: |
| 12 | path: repo |
| 13 | - name: Download Coverity Build Tool |
| 14 | run: | |
| 15 | wget https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=fontforge%2Ffontforge" -O cov-analysis-linux64.tar.gz |
| 16 | mkdir cov-analysis-linux64 |
| 17 | tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 |
| 18 | echo "PATH=$(pwd)/cov-analysis-linux64/bin:$PATH" >> $GITHUB_ENV |
| 19 | env: |
| 20 | TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} |
| 21 | - name: Restore cached custom dependencies |
| 22 | id: cache-dependencies |
| 23 | uses: actions/cache@v3 |
| 24 | with: |
| 25 | path: deps/install |
| 26 | key: ${{ runner.os }}-deps-${{ hashFiles('repo/.github/workflows/scripts/setup_linux_deps.sh') }} |
| 27 | - name: Install dependencies and setup env vars |
| 28 | run: ${{ github.workspace }}/repo/.github/workflows/scripts/setup_linux_deps.sh |
| 29 | - name: Build FontForge with Coverity |
| 30 | working-directory: repo |
| 31 | run: | |
| 32 | FFCONFIG="-DCMAKE_INSTALL_PREFIX=$PREFIX -DENABLE_FONTFORGE_EXTRAS=ON -DENABLE_FREETYPE_DEBUGGER=$DEPSPREFIX/freetype" |
| 33 | mkdir build && pushd build |
| 34 | cmake -GNinja $FFCONFIG .. |
| 35 | cov-build --dir cov-int ninja |
| 36 | # cat cov-int/build-log.txt |
| 37 | - name: Submit the result to Coverity Scan |
| 38 | working-directory: repo/build |
| 39 | run: | |
| 40 | tar czvf fontforge.tgz cov-int |
| 41 | curl \ |
| 42 | --form project=fontforge \ |
| 43 | --form token=$TOKEN \ |
| 44 | --form [email protected] \ |
| 45 | --form [email protected] \ |
| 46 | --form version=${{ github.sha }} \ |
| 47 | --form description="FontForge" \ |
| 48 | https://scan.coverity.com/builds?project=fontforge%2Ffontforge |
| 49 | env: |
| 50 | TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} |