aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/coverity.yml
blob: e1bfcb0c96fbdd26823cb86e426e9e455a6e16d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Coverity

on:
  workflow_dispatch:
  schedule:
  - cron: "0 0 * * *"

jobs:
  scan:
    runs-on: ubuntu-latest
    if: ${{ github.repository_owner == 'libressl' }}
    steps:
    - uses: actions/checkout@main
    - name: Install apt dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y cmake ninja-build
    - name: Download Coverity build tool
      run: |
        wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=libressl-portable%2Fportable" -O coverity_tool.tar.gz
        mkdir coverity_tool
        tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool
    - name: Configure
      run: |
        ./autogen.sh
        ./configure
        make dist
        tar zxf libressl-*.tar.gz
        rm libressl-*.tar.gz
        cd libressl-*
        mkdir build-static
        mkdir build-shared 
        cmake -GNinja -DBUILD_SHARED_LIBS=ON ..
    - name: Build with Coverity build tool
      run: |
        export PATH=`pwd`/coverity_tool/bin:$PATH
        cd libressl-*
        cov-build --dir cov-int ninja
    - name: Submit build result to Coverity Scan
      run: |
        cd libressl-*
        tar czvf cov.tar.gz cov-int
        curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
          --form email=libressl-security@openbsd.org \
          --form file=@cov.tar.gz \
          --form version="Commit $GITHUB_SHA" \
          --form description="Build submitted via CI" \
          https://scan.coverity.com/builds?project=libressl-portable%2Fportable