libtommath: Fix possible integer overflow CVE-2023-36328
[heimdal.git] / .github / workflows / linux.yml
blob1bbfbb4ec246c874ea089e446f72f3f1c1e24231
1 name: Linux Build
3 on:
4     push:
5       branches:
6          - 'master'
7          - 'heimdal-7-1-branch'
8       paths:
9          - '!docs/**'
10          - '!**.md'
11          - '!**.[1-9]'
12          - '**.[chly]'
13          - '**.hin'
14          - '**.in'
15          - '**.am'
16          - '**.m4'
17          - '**.ac'
18          - '**.pl'
19          - '**.py'
20          - '**.asn1'
21          - '**.opt'
22          - '**/COPYING'
23          - '**/INSTALL'
24          - '**/README*'
25          - '.github/workflows/linux.yml'
26          - '!appveyor.yml'
27          - '!.travis.yml'
29     pull_request:
30       paths:
31          - '!docs/**'
32          - '!**.md'
33          - '!**.[1-9]'
34          - '**.[chly]'
35          - '**.hin'
36          - '**.in'
37          - '**.am'
38          - '**.m4'
39          - '**.ac'
40          - '**.pl'
41          - '**.py'
42          - '**.asn1'
43          - '**.opt'
44          - '**/COPYING'
45          - '**/INSTALL'
46          - '**/README*'
47          - '.github/workflows/linux.yml'
48          - '!appveyor.yml'
49          - '!.travis.yml'
51 jobs:
52     unix:
53         runs-on: ${{ matrix.os }}
54         strategy:
55             fail-fast: false
56             matrix:
57                 name: [linux-clang, linux-gcc]
58                 include:
59                     - name: linux-clang
60                       os: ubuntu-22.04
61                       compiler: clang
62                       cflags: ''
63                     - name: linux-gcc
64                       os: ubuntu-22.04
65                       compiler: gcc
66                       cflags: '-Wnonnull'
67         steps:
68             - name: Clone repository
69               uses: actions/checkout@v1
70             - name: Install packages
71               if: startsWith(matrix.os, 'ubuntu')
72               run: |
73                 sudo apt-get update -qq
74                 sudo apt-get install -y bison comerr-dev flex doxygen
75                 sudo apt-get install -y libcap-ng-dev libdb-dev libedit-dev libjson-perl
76                 sudo apt-get install -y libldap2-dev libncurses5-dev libperl4-corelibs-perl
77                 sudo apt-get install -y libsqlite3-dev libkeyutils-dev pkg-config python3
78                 sudo apt-get install -y ss-dev texinfo unzip netbase keyutils ldap-utils
79                 sudo apt-get install -y gdb apport curl libmicrohttpd-dev jq valgrind
80                 # Temporary workaround for:
81                 # https://github.com/actions/virtual-environments/issues/3185
82                 sudo hostname localhost
83             - name: Build
84               env:
85                 CC: ${{ matrix.compiler }}
86                 MAKEVARS: ${{ matrix.makevars }}
87               run: |
88                 /bin/sh ./autogen.sh
89                 mkdir build
90                 cd build
91                 ../configure --srcdir=`dirname "$PWD"` --enable-maintainer-mode --enable-developer --with-ldap $CONFIGURE_OPTS --prefix=$HOME/inst CFLAGS="${{ matrix.cflags }} -Wno-error=shadow -Wno-error=bad-function-cast -Wno-error=unused-function -Wno-error=unused-result -Wno-error=deprecated-declarations"
92                 make -j4
93             - name: Test
94               env:
95                 CC: ${{ matrix.compiler }}
96                 MAKEVARS: ${{ matrix.makevars }}
97               run: |
98                 cd build
99                 ulimit -c unlimited
100                 make check
101             - name: Make Install
102               env:
103                 CC: ${{ matrix.compiler }}
104                 MAKEVARS: ${{ matrix.makevars }}
105               run: |
106                 cd build || true
107                 make DESTDIR=/tmp/h5l install
108                 cd /tmp/h5l
109                 tar czf $HOME/heimdal-install-linux-${{ matrix.compiler }}.tgz .
110             - name: Core dump stacks
111               run: |
112                 echo "thread apply all bt" > /tmp/x
113                 find . -name core -print | while read core; do gdb -batch -x x `file "$core"|sed -e "s/^[^']*'//" -e "s/[ '].*$//"` "$core"; done
114                 if [ "$(find . -name core -print | wc -l)" -gt 0 ]; then false; fi
115             - name: Test logs
116               run: |
117                 find build -depth -name \*.trs | xargs grep -lw FAIL | sed -e 's/trs$/log/' | tar -czf $HOME/logs-linux-${{ matrix.compiler }}.tgz --verbatim-files-from --files-from -
118                 find build -name \*.trs | xargs grep -lw FAIL | sed -e 's/trs$/log/' | xargs cat
119             - name: Failed Test logs
120               if: ${{ failure() }}
121               run: |
122                 find build -name \*.trs | xargs grep -lw FAIL | sed -e 's/trs$/log/' | xargs cat
123             - name: Make Dist
124               run: |
125                 cd build
126                 make dist
127                 make distclean
128                 if [ "$(git ls-files -o|grep -v ^build/ | wc -l)" -ne 0 ]; then
129                   echo "Files not removed by make distclean:"
130                   git ls-files -o|grep -v ^build/
131                 fi
132             - name: Upload Install Tarball
133               uses: actions/upload-artifact@v2
134               with:
135                 name: Install Tarball
136                 path: '~/heimdal-install-linux-${{ matrix.compiler }}.tgz'
137             - name: Upload Dist Tarball
138               uses: actions/upload-artifact@v2
139               with:
140                 name: Dist Tarball
141                 path: 'build/heimdal-*.tar.gz'
142             - name: Upload Logs Tarball
143               uses: actions/upload-artifact@v2
144               with:
145                 name: Test Logs
146                 path: '~/logs-linux-${{ matrix.compiler }}.tgz'