File: coverity_scan.yml

package info (click to toggle)
authselect 1.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,416 kB
  • sloc: ansic: 7,807; sh: 477; makefile: 356; python: 164; xml: 24
file content (89 lines) | stat: -rw-r--r-- 2,433 bytes parent folder | download
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Coverity Scan
on:
  workflow_dispatch:
  schedule:
    - cron: '30 0 * * *'
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  has_changed:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    outputs:
      changed: ${{ steps.check.outputs.changed }}
    steps:
      - uses: actions/checkout@v4
      - name: Print latest commit
        run: echo ${{ github.sha }}

      - id: check
        name: Check that there were changes in the repository in the last 24 hours
        run: |
          commits=`git rev-list  --after="24 hours"  ${{ github.sha }}`
          if [ -z "$commits" ]; then
            echo "::set-output name=changed::false"
            exit 0
          fi

          echo "::set-output name=changed::true"

  submit:
    needs: has_changed
    if: ${{ needs.has_changed.outputs.changed == 'true' }}
    runs-on: ubuntu-latest
    permissions:
      contents: read
    env:
      TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Load Coverity Scan tool from cache
      id: cache
      uses: actions/cache@v4
      with:
        path: covscan
        key: ${{ runner.os }}-covscan

    - name: Download Coverity Build Tool
      if: steps.cache.outputs.cache-hit != 'true'
      run: |
        set -ex

        curl \
          --data "token=$TOKEN&project=authselect%2Fauthselect" \
          -o covscan.tar.gz \
          https://scan.coverity.com/download/linux64
        mkdir covscan
        tar -xzf covscan.tar.gz --strip 1 -C covscan
        rm covscan.tar.gz

    - name: Install dependencies
      run: |
        sudo scripts/auto install-build-deps

    - run: autoreconf -if && ./configure --enable-silent-rules

    - name: Build with cov-build
      run: |
        export PATH="$(pwd)/covscan/bin:$PATH"
        cov-build --dir cov-int make

    - name: Print logs
      run: |
        cat cov-int/build-log.txt

    - name: Submit the result to Coverity Scan
      run: |
        tar -czvf build.tgz cov-int
        curl \
          --form project=authselect/authselect \
          --form token=$TOKEN \
          --form email=pbrezina@redhat.com \
          --form file=@build.tgz \
          --form version=master \
          --form description="Latest upstream code." \
          https://scan.coverity.com/builds?project=authselect%2Fauthselect