xref: /openssl/.github/workflows/coveralls.yml (revision 7ed6de99)
1# Copyright 2021-2024 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: Coverage
9
10# Run once a day
11on:
12  schedule:
13    - cron:  '49 0 * * *'
14
15permissions:
16  contents: read
17
18jobs:
19  coverage:
20    permissions:
21      checks: write     # for coverallsapp/github-action to create new checks
22      contents: read    # for actions/checkout to fetch code
23    strategy:
24      fail-fast: false
25      matrix:
26        branches: [
27          {
28            branch: openssl-3.3,
29            extra_config: no-afalgeng enable-fips enable-tfo
30          }, {
31            branch: openssl-3.2,
32            extra_config: no-afalgeng enable-fips enable-tfo
33          }, {
34            branch: openssl-3.1,
35            extra_config: no-afalgeng enable-fips
36          }, {
37            branch: openssl-3.0,
38            extra_config: no-afalgeng enable-fips
39          }, {
40            branch: master,
41            extra_config: no-afalgeng enable-fips enable-tfo
42          }
43        ]
44    runs-on: ubuntu-latest
45    steps:
46    - uses: actions/checkout@v4
47      with:
48        submodules: recursive
49        ref: ${{ matrix.branches.branch }}
50    - name: cache commit id
51      run: |
52        echo "githubid=`/usr/bin/git log -1 --format='%H'`" >>$GITHUB_ENV
53    - name: package installs
54      run: |
55        sudo apt-get update
56        sudo apt-get -yq install lcov
57        sudo apt-get -yq install bison gettext keyutils ldap-utils libldap2-dev libkeyutils-dev python3 python3-paste python3-pyrad slapd tcsh python3-virtualenv virtualenv python3-kdcproxy
58    - name: install Test2::V0 for gost_engine testing
59      uses: perl-actions/install-with-cpanm@stable
60      with:
61        install: Test2::V0
62    - name: setup hostname workaround
63      run: sudo hostname localhost
64    - name: config
65      run: CC=gcc ./config --debug --coverage ${{ matrix.branches.extra_config }} no-asm enable-rc5 enable-md2 enable-ssl3 enable-nextprotoneg enable-ssl3-method enable-weak-ssl-ciphers enable-zlib enable-ec_nistp_64_gcc_128 enable-buildtest-c++ enable-ssl-trace enable-trace
66    - name: config dump
67      run: ./configdata.pm --dump
68    - name: make
69      run: make -s -j4
70    - name: get cpu info
71      run: |
72        cat /proc/cpuinfo
73        ./util/opensslwrap.sh version -c
74    - name: make test
75      run: make test TESTS='-test_external_krb5'
76    - name: generate coverage info
77      run: lcov -d . -c
78             --exclude "${PWD}/test/*"
79             --exclude "${PWD}/test/helpers/*"
80             --exclude "${PWD}/test/testutil/*"
81             --exclude "${PWD}/fuzz/*"
82             --exclude "/usr/include/*"
83              -o ./lcov.info
84    - name: Coveralls upload
85      uses: coverallsapp/github-action@v2.3.0
86      with:
87        github-token: ${{ secrets.github_token }}
88        git-branch: ${{ matrix.branches.branch }}
89        git-commit: ${{ env.githubid }}
90        path-to-lcov: ./lcov.info
91