fix memory leaks found by coverity (#11) #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TestBuildOnLinux | |
on: | |
# push: | |
# branches: | |
# - master | |
# paths-ignore: | |
# - ".github/**" | |
# - "bin/**" | |
# - "build/**" | |
# - "conf/**" | |
# - "create/**" | |
# - "database/**" | |
# - "man/**" | |
# - "misc/**" | |
# - "packages/**" | |
# - "sass/**" | |
# - "templates/**" | |
# - "tests/**" | |
# - "ui/**" | |
# - "vs2017/**" | |
push: | |
paths: | |
- "src/**" | |
- "include/**" | |
- "m4/**" | |
- "configure.ac" | |
- "Makefile.am" | |
pull_request: | |
paths: | |
- "src/**" | |
- "include/**" | |
- "m4/**" | |
- "configure.ac" | |
- "Makefile.am" | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: 'Launch reason' | |
required: true | |
default: 'Run test build' | |
jobs: | |
github-job: | |
name: Ubuntu (MySQL, PgSQL) | |
runs-on: [ubuntu-22.04] | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y autoconf automake gcc make wget unzip gettext libxml2-dev libssl-dev libcurl4-openssl-dev libpcre2-dev libconfig-dev libsnmp-dev libsqlite3-dev libopenipmi-dev libssh2-1-dev unixodbc-dev libevent-dev | |
sudo apt-get install -y dpkg-dev devscripts git dh-make build-essential autoconf autotools-dev quilt pkg-config tar xz-utils curl | |
sudo apt-get install -y libmysqlclient-dev libpq-dev | |
sudo wget https://github.com/sass/dart-sass/releases/download/1.71.1/dart-sass-1.71.1-linux-x64.tar.gz -O /tmp/dart-sass-linux-x64.tar.gz | |
sudo tar -zxf /tmp/dart-sass-linux-x64.tar.gz -C /tmp && yes | sudo cp /tmp/dart-sass/sass /usr/local/sbin && sudo cp -r /tmp/dart-sass/src /usr/local/sbin && sudo rm -rf /tmp/dart-sass dart-sass-linux-x64.tar.gz | |
- name: Code checkout | |
uses: actions/checkout@v2 | |
- name: Delete old binary | |
run: | | |
rm -rf ./bin/aix 2>/dev/null | |
rm -rf ./bin/rhel 2>/dev/null | |
rm -rf ./bin/ubuntu 2>/dev/null | |
rm -rf ./bin/win32/*.pdb 2>/dev/null | |
rm -rf ./bin/win32/*.dll 2>/dev/null | |
rm -rf ./bin/win32/*.exe 2>/dev/null | |
rm -rf ./bin/win32/*.cmd 2>/dev/null | |
rm -rf ./bin/win64/*.pdb 2>/dev/null | |
rm -rf ./bin/win64/*.dll 2>/dev/null | |
rm -rf ./bin/win64/*.exe 2>/dev/null | |
rm -rf ./bin/win64/*.cmd 2>/dev/null | |
rm -f ./include/version.h.win 2>/dev/null | |
- name: Run create bin, img and styles directory | |
run: mkdir -p ./bin/win32/dev ./bin/win64/dev ./ui/assets/img ./ui/assets/styles; chmod a+x ./create/bin/*.{sh,pl} | |
- name: Build zabbix dist | |
run: | | |
./bootstrap.sh | |
./configure | |
make dbschema | |
make gettext | |
make css | |
make dist | |
echo "ZABBIX_VERSION=$(cat configure | grep PACKAGE_VERSION= | cut -d = -f2 | tr -d \')" >> $GITHUB_ENV | |
echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV | |
- name: Prepare build | |
run: tar -zxf zabbix-${{ env.ZABBIX_VERSION }}.tar.gz | |
- name: Build | |
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }} | |
run: | | |
./configure --with-openssl --with-libpthread --with-libpcre2 --with-libcurl --enable-dbmon --enable-dbmon-mysql --enable-dbmon-postgresql --with-mysql --with-postgresql --enable-ipv6 --enable-agent --sysconfdir=/etc/zabbix | |
make | |
- name: Show build version | |
working-directory: ./zabbix-${{ env.ZABBIX_VERSION }} | |
run: | | |
ldd ./src/zabbix_agent/zabbix_agentd | |
echo ---------------------------------------------- | |
./src/zabbix_agent/zabbix_agentd -V |