# Copyright 2019 Ilya Shipitsin <chipitsine@gmail.com>
# Copyright 2020 Tim Duesterhus <tim@bastelstu.be>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version
# 2 of the License, or (at your option) any later version.

name: VTest

on:
  push:

jobs:
  # The generate-matrix job generates the build matrix using JSON output
  # generated by .github/matrix.py.
  generate-matrix:
    name: Generate Build Matrix
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.set-matrix.outputs.matrix }}
    steps:
      - uses: actions/checkout@v2
      - name: Generate Build Matrix
        id: set-matrix
        run: python3 .github/matrix.py "${{ github.event_name }}"

  # The Test job actually runs the tests.
  Test:
    name: ${{ matrix.name }}
    needs: generate-matrix
    runs-on: ${{ matrix.os }}
    strategy:
      matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
      fail-fast: false
    env:
      # Configure a short TMPDIR to prevent failures due to long unix socket
      # paths.
      TMPDIR: /tmp
      # Force ASAN output into asan.log to make the output more readable.
      ASAN_OPTIONS: log_path=asan.log
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 100
    - name: Install apt dependencies
      if: ${{ startsWith(matrix.os, 'ubuntu-') }}
      run: |
        sudo apt-get update
        sudo apt-get install -y \
          liblua5.3-dev \
          libpcre2-dev \
          libsystemd-dev \
          ninja-build \
          socat
    - name: Install brew dependencies
      if: ${{ startsWith(matrix.os, 'macos-') }}
      run: |
        brew install socat
        brew install lua
    - name: Install VTest
      run: |
        scripts/build-vtest.sh
    - name: Install SSL ${{ matrix.ssl }}
      if: ${{ matrix.ssl && matrix.ssl != 'stock' }}
      run: env ${{ matrix.ssl }} scripts/build-ssl.sh
    - name: Install OpenTracing libs
      if: ${{ contains(matrix.FLAGS, 'USE_OT=1') }}
      run: scripts/build-ot.sh
    - name: Build WURFL
      if: ${{ contains(matrix.FLAGS, 'USE_WURFL=1') }}
      run: make -C addons/wurfl/dummy
    - name: Compile HAProxy with ${{ matrix.CC }}
      run: |
        make -j$(nproc) all \
          ERR=1 \
          TARGET=${{ matrix.TARGET }} \
          CC=${{ matrix.CC }} \
          DEBUG=-DDEBUG_STRICT=1 \
          ${{ join(matrix.FLAGS, ' ') }} \
          ADDLIB="-Wl,-rpath,/usr/local/lib/ -Wl,-rpath,$HOME/opt/lib/"
        sudo make install
    - name: Show HAProxy version
      id: show-version
      run: |
        echo "::group::Show dynamic libraries."
        if command -v ldd > /dev/null; then
          # Linux
          ldd $(which haproxy)
        else
          # macOS
          otool -L $(which haproxy)
        fi
        echo "::endgroup::"
        haproxy -vv
        echo "::set-output name=version::$(haproxy -v |awk 'NR==1{print $3}')"
    - name: Install problem matcher for VTest
      # This allows one to more easily see which tests fail.
      run: echo "::add-matcher::.github/vtest.json"
    - name: Run VTest for HAProxy ${{ steps.show-version.outputs.version }}
      id: vtest
      run: |
        # This is required for macOS which does not actually allow to increase
        # the '-n' soft limit to the hard limit, thus failing to run.
        ulimit -n 5000
        make reg-tests VTEST_PROGRAM=../vtest/vtest REGTESTS_TYPES=default,bug,devel
    - name: Show results
      if: ${{ failure() }}
      run: |
        for folder in ${TMPDIR}/haregtests-*/vtc.*; do
          printf "::group::"
          cat $folder/INFO
          cat $folder/LOG
          echo "::endgroup::"
        done
        shopt -s nullglob
        for asan in asan.log*; do
          echo "::group::$asan"
          cat $asan
          echo "::endgroup::"
        done
