-
Notifications
You must be signed in to change notification settings - Fork 24
73 lines (63 loc) · 3.02 KB
/
Copy pathci.yml
File metadata and controls
73 lines (63 loc) · 3.02 KB
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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
fail-fast: false
matrix:
runtime:
- name: apisix-runtime
script_url: "https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-runtime.sh"
script_name: "build-apisix-runtime.sh"
# These assert stream-lua internal buffer-allocation debug logs that
# changed in OpenResty 1.29.2.4 (stream-lua 0.0.19); they still run on
# api7ee-runtime (OR 1.21, stream-lua 0.0.16) for functional coverage.
exclude_tests: "t/stream/xrpc/downstream.t t/stream/xrpc/upstream.t"
- name: api7ee-runtime
script_url: "https://raw.githubusercontent.com/api7/apisix-build-tools/release/api7ee-runtime/build-api7ee-runtime.sh"
script_name: "build-api7ee-runtime.sh"
# Tests requiring nginx features not available in OR 1.21 (nginx 1.21)
exclude_tests: "t/pipe.t t/upstream_pass_trailers.t"
runs-on: "ubuntu-latest"
name: build (${{ matrix.runtime.name }})
env:
OPENRESTY_PREFIX: "/usr/local/openresty"
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up build environment
run: |
sudo apt update
sudo apt install -y git wget build-essential
- name: Get dependencies
run: |
sudo apt install -y cpanminus build-essential libncurses5-dev libreadline-dev libssl-dev perl luarocks libpcre3 libpcre3-dev zlib1g-dev
sudo luarocks install lua-resty-http > build.log 2>&1 || (cat build.log && exit 1)
sudo luarocks install lua-resty-openssl > build.log 2>&1 || (cat build.log && exit 1)
cd t/assets/grpc && ./setup.sh > build.log 2>&1 || (cat build.log && exit 1) && cd ../../..
- name: Before install
run: |
sudo cpanm --notest Test::Nginx > build.log 2>&1 || (cat build.log && exit 1)
git clone https://github.com/openresty/test-nginx.git test-nginx
- name: Install
run: |
wget ${{ matrix.runtime.script_url }}
chmod +x ${{ matrix.runtime.script_name }}
# Fix permission issue: EE script does rm without sudo after sudo make install
sed -i 's|rm -rf "$OPENSSL_PREFIX"/share|sudo rm -rf "$OPENSSL_PREFIX"/share|' ${{ matrix.runtime.script_name }}
OR_PREFIX=$OPENRESTY_PREFIX CC="gcc -fsanitize=address -fdiagnostics-color=always -Werror -Wno-unused-but-set-variable -Wno-unused-parameter" \
./${{ matrix.runtime.script_name }} latest
- name: Script
run: |
export PATH=$OPENRESTY_PREFIX/nginx/sbin:$PATH
TEST_FILES=$(find t/ -name '*.t' -type f | sort)
if [ -n "${{ matrix.runtime.exclude_tests }}" ]; then
for f in ${{ matrix.runtime.exclude_tests }}; do
TEST_FILES=$(echo "$TEST_FILES" | grep -v "^${f}$")
done
fi
echo "$TEST_FILES" | xargs prove -I. -Itest-nginx/lib