-
Notifications
You must be signed in to change notification settings - Fork 112
96 lines (91 loc) · 3.65 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
90
91
92
93
94
95
96
name: test
on: push
defaults:
run:
shell: bash
env:
OPENSSL_SRC_VERSION: 1.1.1w
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
NGINX_VERSION:
- 1.25.2
- 1.24.0
BUILD_DYNAMIC_MODULE:
- ""
- "TRUE"
BUILD_WITH_OPENSSL_SRC:
- ""
- "TRUE"
steps:
- uses: actions/checkout@v4
- name: Echo matrix
env:
NGINX_VERSION: ${{ matrix.NGINX_VERSION }}
BUILD_DYNAMIC_MODULE: ${{ matrix.BUILD_DYNAMIC_MODULE }}
BUILD_WITH_OPENSSL_SRC: ${{ matrix.BUILD_WITH_OPENSSL_SRC }}
run: |
echo $NGINX_VERSION
echo $BUILD_DYNAMIC_MODULE
echo $BUILD_WITH_OPENSSL_SRC
- name: before_install
env:
NGINX_VERSION: ${{ matrix.NGINX_VERSION }}
BUILD_DYNAMIC_MODULE: ${{ matrix.BUILD_DYNAMIC_MODULE }}
BUILD_WITH_OPENSSL_SRC: ${{ matrix.BUILD_WITH_OPENSSL_SRC }}
run: |
sudo apt-get -qq update
- name: install
env:
NGINX_VERSION: ${{ matrix.NGINX_VERSION }}
BUILD_DYNAMIC_MODULE: ${{ matrix.BUILD_DYNAMIC_MODULE }}
BUILD_WITH_OPENSSL_SRC: ${{ matrix.BUILD_WITH_OPENSSL_SRC }}
CXX: g++
run: |
sudo apt-get -qq install rake bison git gperf zlib1g-dev g++-11 libstdc++-11-dev valgrind
sudo apt-get remove -y libssl-dev
if [ "$CXX" = "g++" ]; then
export CXX="g++-11" CC="gcc-11" LD="gcc-11"
echo "CXX=g++-11" >> $GITHUB_ENV
echo "CC=gcc-11" >> $GITHUB_ENV
echo "LD=gcc-11" >> $GITHUB_ENV
fi
$CXX -v
- name: before_script
env:
NGINX_VERSION: ${{ matrix.NGINX_VERSION }}
BUILD_DYNAMIC_MODULE: ${{ matrix.BUILD_DYNAMIC_MODULE }}
BUILD_WITH_OPENSSL_SRC: ${{ matrix.BUILD_WITH_OPENSSL_SRC }}
run: |
curl -sfL https://www.openssl.org/source/openssl-${OPENSSL_SRC_VERSION}.tar.gz -o openssl-${OPENSSL_SRC_VERSION}.tar.gz
mkdir openssl-${OPENSSL_SRC_VERSION} && tar -xzf openssl-${OPENSSL_SRC_VERSION}.tar.gz -C openssl-${OPENSSL_SRC_VERSION} --strip-components 1
rm openssl-${OPENSSL_SRC_VERSION}.tar.gz
cd openssl-${OPENSSL_SRC_VERSION}
./config --prefix=/usr/local --shared zlib -fPIC >> /dev/null 2>&1
make >> /dev/null 2>&1
sudo make install >> /dev/null 2>&1
sudo ldconfig /usr/local/lib
cd -
openssl version
- name: script
env:
NGINX_VERSION: ${{ matrix.NGINX_VERSION }}
BUILD_DYNAMIC_MODULE: ${{ matrix.BUILD_DYNAMIC_MODULE }}
BUILD_WITH_OPENSSL_SRC: ${{ matrix.BUILD_WITH_OPENSSL_SRC }}
NUM_THREADS_ENV: 1
NGINX_RUNNER: valgrind
NGINX_HEATTIME: 10
run: |
echo "NGINX_SRC_MAJOR=$(echo $NGINX_VERSION | cut -d '.' -f 1)" > nginx_version
echo "NGINX_SRC_MINOR=$(echo $NGINX_VERSION | cut -d '.' -f 2)" >> nginx_version
echo "NGINX_SRC_PATCH=$(echo $NGINX_VERSION | cut -d '.' -f 3)" >> nginx_version
echo "NGINX_SRC_VER=nginx-${NGINX_VERSION}" >> nginx_version
if [ "${BUILD_WITH_OPENSSL_SRC}" == "TRUE" ]; then build_opts="--with-openssl-src=${PWD}/openssl-${OPENSSL_SRC_VERSION}"; fi
sh test.sh ${build_opts}
- name: after_failure
if: failure()
run: |
if [ -e build/nginx/logs/error.log ]; then cat build/nginx/logs/error.log ; else cat build_dynamic/nginx/logs/error.log; fi
if [ -e build/nginx/logs/stderr.log ]; then cat build/nginx/logs/stderr.log ; else cat build_dynamic/nginx/logs/stderr.log; fi