1# Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
2#
3# Licensed under the Apache License 2.0 (the "License").  You may not use
4# this file except in compliance with the License.  You can obtain a copy
5# in the file LICENSE in the source distribution or at
6# https://www.openssl.org/source/license.html
7
8name: Static Analysis
9
10#Run once a day
11on:
12  schedule:
13    - cron:  '20 02 * * *'
14  workflow_dispatch:
15
16permissions:
17  contents: read
18
19jobs:
20  coverity:
21    runs-on: ubuntu-latest
22    steps:
23    - uses: actions/checkout@v4
24    - name: tool download
25      run: |
26        wget https://scan.coverity.com/download/linux64 \
27             --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=openssl%2Fopenssl" \
28             --progress=dot:giga -O coverity_tool.tgz
29    - name: config
30      run: CC=gcc ./config --banner=Configured --debug enable-fips enable-rc5 enable-md2 enable-ssl3 enable-nextprotoneg enable-ssl3-method enable-weak-ssl-ciphers enable-zlib enable-ec_nistp_64_gcc_128 no-shared enable-buildtest-c++ enable-external-tests -DPEDANTIC
31    - name: config dump
32      run: ./configdata.pm --dump
33    - name: tool install
34      run: tar xzf coverity_tool.tgz
35    - name: make
36      run: ./cov-analysis*/bin/cov-build --dir cov-int make -s -j4
37    - name: archive
38      run: tar czvf openssl.tgz cov-int
39    - name: Coverity upload
40      run: |
41        curl --form token="${{ secrets.COVERITY_TOKEN }}" \
42             --form email=openssl-commits@openssl.org \
43             --form file=@openssl.tgz \
44             --form version="`date -u -I` `git rev-parse --short HEAD`" \
45             --form description="analysis of `git branch --show-current`" \
46             https://scan.coverity.com/builds?project=openssl%2Fopenssl
47