-
Notifications
You must be signed in to change notification settings - Fork 28
89 lines (86 loc) · 2.9 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# 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"
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
)