Skip to content

Test

Test #380

Workflow file for this run

# The MIT License (MIT)
#
# Copyright (c) 2020 Tim Düsterhus
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# SPDX-License-Identifier: MIT
name: Test
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
VTest:
runs-on: ubuntu-latest
strategy:
matrix:
haproxy-versions:
- "1.8"
- "1.9"
- "2.0"
- "2.1"
- "2.2"
- "2.3"
- "2.4"
- "2.5"
- "2.6"
- "2.7"
- "2.8"
- "2.9"
- "3.0"
- "3.1"
fail-fast: false
steps:
- name: Install HAProxy ${{ matrix.haproxy-versions }}.
uses: timwolla/action-install-haproxy@main
id: install-haproxy
with:
branch: ${{ matrix.haproxy-versions }}
install_vtest: yes
use_lua: yes
- name: Install apt dependencies.
run: sudo apt-get install -y lua-json
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install haproxy-lua-http globally.
run: |
sudo install -m755 -d /usr/local/share/lua/5.3/
sudo install -m644 haproxy-lua-http/http.lua /usr/local/share/lua/5.3/haproxy-lua-http.lua
sed -i 's/lua-prepend-path/#lua-prepend-path/g' test/*.vtc
- name: Install problem matcher for VTest.
run: echo "::add-matcher::.github/vtest.json"
- name: Run tests using HAProxy ${{ steps.install-haproxy.outputs.version }}.
run: |
set -euo pipefail
vtest -Dhaproxy_version=${{ steps.install-haproxy.outputs.version }} -k -t 10 test/*.vtc 2>&1 \
|tee >(
awk '
$5=="passed"{icon=":heavy_check_mark:"}
$5=="skipped"{icon=":grey_question:"}
$5=="FAILED"{icon=":x:"}
$1 == "#" && $3=="TEST"{
print "- " icon " " $4
}
{line=$0}
END{print "# " $0}
' \
|tac >> $GITHUB_STEP_SUMMARY
)