xref: /src/crypto/krb5/.github/workflows/build.yml (revision b2efd602aea8b3cbc3fb215b9611946d04fceb10)
1name: Build
2
3on:
4    push: {paths: [src/**, .github/workflows/build.yml]}
5    pull_request: {paths: [src/**, .github/workflows/build.yml]}
6
7jobs:
8
9    unix:
10        runs-on: ${{ matrix.os }}
11        strategy:
12            fail-fast: false
13            matrix:
14                name: [linux-clang, linux-clang-openssl, linux-gcc]
15                include:
16                    - name: linux-clang
17                      os: ubuntu-latest
18                      compiler: clang
19                      makevars: CPPFLAGS=-Werror
20                      configureopts: --enable-asan
21                    - name: linux-clang-openssl
22                      os: ubuntu-latest
23                      compiler: clang
24                      makevars: CPPFLAGS=-Werror
25                      configureopts: --with-crypto-impl=openssl
26                    - name: linux-gcc
27                      os: ubuntu-latest
28                      compiler: gcc
29                      makevars: CPPFLAGS=-D_FORTIFY_SOURCE=3
30        steps:
31            - name: Checkout repository
32              uses: actions/checkout@v1
33            - name: Linux setup
34              if: startsWith(matrix.os, 'ubuntu')
35              run: |
36                sudo apt-get update -qq
37                sudo apt-get install -y bison gettext keyutils ldap-utils libcmocka-dev libldap2-dev libkeyutils-dev libsasl2-dev libssl-dev python3-kdcproxy python3-pip slapd tcsh yasm softhsm2 opensc
38                pip3 install pyrad
39            - name: Build
40              env:
41                CC: ${{ matrix.compiler }}
42                MAKEVARS: ${{ matrix.makevars }}
43                CONFIGURE_OPTS:  ${{ matrix.configureopts }}
44              run: |
45                # For the ksu tests, allow homedir access from other users.
46                umask 022
47                chmod a+rx $HOME
48                chmod -R a+rX src
49                cd src
50                autoreconf
51                ./configure --enable-maintainer-mode --with-ldap $CONFIGURE_OPTS --prefix=$HOME/inst
52                make $MAKEVARS
53                make check
54                make install
55                (cd clients/ksu && make check-ksu)
56            - name: Display skipped tests
57              run: cat src/skiptests
58            - name: Check for files unexpectedly not removed by make distclean
59              run: |
60                cd src
61                make distclean
62                rm -rf autom4te.cache configure include/autoconf.h.in
63                if [ -n "$(git ls-files -o)" ]; then
64                  echo "Files not removed by make distclean:"
65                  git ls-files -o
66                  exit 1
67                fi
68
69    windows:
70        runs-on: windows-latest
71        env:
72            KRB_INSTALL_DIR: C:\kfw
73            OPENSSL_DIR: C:\Program Files\OpenSSL
74            OPENSSL_VERSION: 1_1
75        steps:
76            - name: Checkout repository
77              uses: actions/checkout@v1
78            - name: Setup
79              shell: cmd
80              run: |
81                mkdir %KRB_INSTALL_DIR%
82            - uses: ilammy/msvc-dev-cmd@v1
83              with:
84                arch: x64
85            - name: Build
86              working-directory: src
87              run: |
88                $env:Path += ';' + $env:WindowsSdkVerBinPath + '\\x86'
89                nmake -f Makefile.in prep-windows
90                nmake
91            - name: Populate install dir
92              working-directory: src
93              run: |
94                nmake install
95            - name: Build installer
96              working-directory: src\windows\installer\wix
97              run: |
98                $env:Path += ';' + $env:wix + 'bin'
99                nmake
100