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