blob: 1dc216eeb85ca79523b78bc0aed02b83f2660e47 [file] [log] [blame]
Tim Duesterhus288c0772020-07-28 23:00:35 +02001# Copyright 2019 Ilya Shipitsin <chipitsine@gmail.com>
2# Copyright 2020 Tim Duesterhus <tim@bastelstu.be>
3#
4# This program is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License
6# as published by the Free Software Foundation; either version
7# 2 of the License, or (at your option) any later version.
8
9name: VTest
10
11on:
12 push:
13
14jobs:
15 # The generate-matrix job generates the build matrix using JSON output
16 # generated by .github/matrix.py.
17 generate-matrix:
18 name: Generate Build Matrix
19 runs-on: ubuntu-latest
20 outputs:
21 matrix: ${{ steps.set-matrix.outputs.matrix }}
22 steps:
23 - uses: actions/checkout@v2
24 - name: Generate Build Matrix
25 id: set-matrix
Tim Duesterhus8d173e12020-11-20 00:16:00 +010026 run: python3 .github/matrix.py "${{ github.event_name }}"
Tim Duesterhus288c0772020-07-28 23:00:35 +020027
28 # The Test job actually runs the tests.
29 Test:
30 name: ${{ matrix.name }}
31 needs: generate-matrix
32 runs-on: ${{ matrix.os }}
33 strategy:
34 matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
35 fail-fast: false
36 env:
37 # Configure a short TMPDIR to prevent failures due to long unix socket
38 # paths.
39 TMPDIR: /tmp
40 # Force ASAN output into asan.log to make the output more readable.
41 ASAN_OPTIONS: log_path=asan.log
42 steps:
43 - uses: actions/checkout@v2
44 with:
45 fetch-depth: 100
46 - name: Install apt dependencies
47 if: ${{ startsWith(matrix.os, 'ubuntu-') }}
48 run: |
Ilya Shipitsine48853a2020-11-21 13:42:19 +050049 sudo apt-get update
Tim Duesterhus288c0772020-07-28 23:00:35 +020050 sudo apt-get install -y \
51 liblua5.3-dev \
52 libpcre2-dev \
53 libsystemd-dev \
54 ninja-build \
55 socat
56 - name: Install brew dependencies
57 if: ${{ startsWith(matrix.os, 'macos-') }}
58 run: |
59 brew install socat
60 brew install lua
61 - name: Install VTest
62 run: |
Ilya Shipitsin0b038952021-05-15 11:46:15 +050063 scripts/build-vtest.sh
Tim Duesterhus288c0772020-07-28 23:00:35 +020064 - name: Install SSL ${{ matrix.ssl }}
65 if: ${{ matrix.ssl && matrix.ssl != 'stock' }}
66 run: env ${{ matrix.ssl }} scripts/build-ssl.sh
Ilya Shipitsin75c95aa2021-05-18 09:46:43 +000067 - name: Install OpenTracing libs
68 if: ${{ contains(matrix.FLAGS, 'USE_OT=1') }}
69 run: scripts/build-ot.sh
Tim Duesterhus288c0772020-07-28 23:00:35 +020070 - name: Build WURFL
71 if: ${{ contains(matrix.FLAGS, 'USE_WURFL=1') }}
Willy Tarreau57610c62021-04-02 16:39:44 +020072 run: make -C addons/wurfl/dummy
Tim Duesterhus288c0772020-07-28 23:00:35 +020073 - name: Compile HAProxy with ${{ matrix.CC }}
74 run: |
75 make -j$(nproc) all \
76 ERR=1 \
77 TARGET=${{ matrix.TARGET }} \
78 CC=${{ matrix.CC }} \
Tim Duesterhus9fee7e02020-11-21 18:08:00 +010079 DEBUG=-DDEBUG_STRICT=1 \
Tim Duesterhus288c0772020-07-28 23:00:35 +020080 ${{ join(matrix.FLAGS, ' ') }} \
81 ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"
82 sudo make install
83 - name: Show HAProxy version
84 id: show-version
85 run: |
86 echo "::group::Show dynamic libraries."
87 if command -v ldd > /dev/null; then
88 # Linux
89 ldd $(which haproxy)
90 else
91 # macOS
92 otool -L $(which haproxy)
93 fi
94 echo "::endgroup::"
95 haproxy -vv
96 echo "::set-output name=version::$(haproxy -v |awk 'NR==1{print $3}')"
Tim Duesterhus288c0772020-07-28 23:00:35 +020097 - name: Install problem matcher for VTest
98 # This allows one to more easily see which tests fail.
99 run: echo "::add-matcher::.github/vtest.json"
100 - name: Run VTest for HAProxy ${{ steps.show-version.outputs.version }}
101 id: vtest
Tim Duesterhus8a91fa42021-06-13 15:02:24 +0200102 run: |
103 # This is required for macOS which does not actually allow to increase
104 # the '-n' soft limit to the hard limit, thus failing to run.
105 ulimit -n 5000
106 make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
Tim Duesterhus288c0772020-07-28 23:00:35 +0200107 - name: Show results
108 if: ${{ failure() }}
Tim Duesterhus288c0772020-07-28 23:00:35 +0200109 run: |
Tim Duesterhus288c0772020-07-28 23:00:35 +0200110 for folder in ${TMPDIR}/haregtests-*/vtc.*; do
111 printf "::group::"
112 cat $folder/INFO
113 cat $folder/LOG
114 echo "::endgroup::"
115 done
116 shopt -s nullglob
117 for asan in asan.log*; do
118 echo "::group::$asan"
Tim Duesterhus8a91fa42021-06-13 15:02:24 +0200119 cat $asan
Tim Duesterhus288c0772020-07-28 23:00:35 +0200120 echo "::endgroup::"
121 done