blob: c8399dcd1416a7550c7de3033133fcec904af26d [file] [log] [blame]
name: "MiNiFi-CPP CI"
on: [push, pull_request, workflow_dispatch]
jobs:
macos_xcode_11_2_1:
name: "macos-xcode11.2.1"
runs-on: macos-10.15
timeout-minutes: 90
env:
CCACHE_BASEDIR: ${{ GITHUB.WORKSPACE }}
CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ${{ env.CCACHE_DIR }}
key: macos-xcode11.2.1-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
macos-xcode11.2.1-ccache-${{github.ref}}-
macos-xcode11.2.1-ccache-refs/heads/main-
- id: install_dependencies
run: |
brew update
brew install ossp-uuid boost flex lua@5.3 ccache sqliteodbc automake autoconf
- id: setup_env
name: setup enviroment
run: |
echo "PATH=/usr/lib/ccache:/usr/local/opt/ccache/bin:/usr/local/opt/ccache/libexec:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
sudo xcode-select -switch /Applications/Xcode_11.2.1.app
- name: build
run: |
export PATH="/usr/local/opt/lua@5.3/lib:/usr/local/opt/lua@5.3/include:/usr/local/opt/lua@5.3/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/lua@5.3/lib/pkgconfig"
./bootstrap.sh -e -t && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_LUA_SCRIPTING=1 -DENABLE_AWS=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && cmake --build . --parallel 4
- name: test
run: cd build && make test ARGS="--timeout 300 -j4 --output-on-failure"
macos_xcode_12_0:
name: "macos-xcode12.0"
runs-on: macos-10.15
timeout-minutes: 90
env:
CCACHE_BASEDIR: ${{ GITHUB.WORKSPACE }}
CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ${{ env.CCACHE_DIR }}
key: macos-xcode12.0-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
macos-xcode12.0-ccache-${{github.ref}}-
macos-xcode12.0-ccache-refs/heads/main-
- id: install_dependencies
run: |
brew update
brew install ossp-uuid boost flex lua@5.3 ccache sqliteodbc automake autoconf
- id: setup_env
name: setup enviroment
run: |
echo "PATH=/usr/lib/ccache:/usr/local/opt/ccache/bin:/usr/local/opt/ccache/libexec:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
sudo xcode-select -switch /Applications/Xcode_12.app
- name: build
run: |
export PATH="/usr/local/opt/lua@5.3/lib:/usr/local/opt/lua@5.3/include:/usr/local/opt/lua@5.3/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/lua@5.3/lib/pkgconfig"
./bootstrap.sh -e -t && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_LUA_SCRIPTING=1 -DENABLE_SQL=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && cmake --build . --parallel 4
- name: test
run: cd build && make test ARGS="--timeout 300 -j4 --output-on-failure"
- name: linter
run: cd build && make linter
windows_VS2017:
name: "windows-vs2017"
runs-on: windows-2016
timeout-minutes: 120
env:
CLCACHE_DIR: ${{ GITHUB.WORKSPACE }}\clcache
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ${{ env.CLCACHE_DIR }}
key: windows-vs2017-clcache-${{github.ref}}-${{github.sha}}
restore-keys: |
windows-vs2017-clcache-${{github.ref}}-
windows-vs2017-clcache-refs/heads/main-
- name: Setup PATH
uses: microsoft/setup-msbuild@v1.0.2
- id: install-sqliteodbc-driver
run: |
Invoke-WebRequest -Uri "http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe" -OutFile "sqliteodbc.exe"
./sqliteodbc.exe /S
shell: powershell
- name: Setup clcache
run: |
(New-Object System.Net.WebClient).DownloadFile('https://github.com/frerich/clcache/releases/download/v4.2.0/clcache-4.2.0.zip', "$pwd\clcache.zip")
$cl_exe_dir = Split-Path -parent $(vswhere -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find VC\Tools\MSVC\**\bin\Hostx86\x86\cl.exe | select-object -last 1)
Expand-Archive -Force -Path clcache.zip -DestinationPath "$cl_exe_dir";
move "$cl_exe_dir\cl.exe" "$cl_exe_dir\cl_original.exe"
move "$cl_exe_dir\cl.exe.config" "$cl_exe_dir\cl_original.exe.config"
move "$cl_exe_dir\clcache.exe" "$cl_exe_dir\cl.exe"
echo "CLCACHE_CL=$cl_exe_dir\cl_original.exe" >> $env:GITHUB_ENV
echo "CLCACHE_NODIRECT=1" >> $env:GITHUB_ENV
- name: build
run: |
PATH %PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86
PATH %PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn
win_build_vs.bat build /CI /S /A /Z /PDH /R
shell: cmd
- name: test
run: cd build && ctest --timeout 300 --parallel 8 -C Release --output-on-failure
shell: cmd
windows_VS2019:
name: "windows-vs2019"
runs-on: windows-2019
timeout-minutes: 120
env:
CLCACHE_DIR: ${{ GITHUB.WORKSPACE }}\clcache
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ${{ env.CLCACHE_DIR }}
key: windows-vs2019-clcache-${{github.ref}}-${{github.sha}}
restore-keys: |
windows-vs2019-clcache-${{github.ref}}-
windows-vs2019-clcache-refs/heads/main-
- name: Setup PATH
uses: microsoft/setup-msbuild@v1.0.2
- id: install-sqliteodbc-driver
run: |
Invoke-WebRequest -Uri "http://www.ch-werner.de/sqliteodbc/sqliteodbc_w64.exe" -OutFile "sqliteodbc_w64.exe"
./sqliteodbc_w64.exe /S
shell: powershell
- name: Setup clcache
run: |
(New-Object System.Net.WebClient).DownloadFile('https://github.com/frerich/clcache/releases/download/v4.2.0/clcache-4.2.0.zip', "$pwd\clcache.zip")
$cl_exe_dir = Split-Path -parent $(vswhere -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find VC\Tools\MSVC\**\bin\Hostx64\x64\cl.exe | select-object -last 1)
Expand-Archive -Force -Path clcache.zip -DestinationPath "$cl_exe_dir";
move "$cl_exe_dir\cl.exe" "$cl_exe_dir\cl_original.exe"
move "$cl_exe_dir\cl.exe.config" "$cl_exe_dir\cl_original.exe.config"
move "$cl_exe_dir\clcache.exe" "$cl_exe_dir\cl.exe"
echo "CLCACHE_CL=$cl_exe_dir\cl_original.exe" >> $env:GITHUB_ENV
echo "CLCACHE_NODIRECT=1" >> $env:GITHUB_ENV
- name: build
run: |
PATH %PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
PATH %PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Roslyn
win_build_vs.bat build /2019 /64 /CI /S /A /PDH /K /L /R
shell: cmd
- name: test
run: cd build && ctest --timeout 300 --parallel 8 -C Release --output-on-failure
shell: cmd
- name: linter
run: cd build && msbuild linter.vcxproj
shell: cmd
ubuntu_16_04:
name: "ubuntu-16.04"
runs-on: ubuntu-16.04
timeout-minutes: 60
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ubuntu-16.04-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-16.04-ccache-${{github.ref}}-
ubuntu-16.04-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- name: build
run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF -DSTRICT_GSL_CHECKS=AUDIT .. && cmake --build . --parallel 4
- name: test
run: cd build && make test ARGS="--timeout 300 -j2 --output-on-failure"
ubuntu_16_04_gcc_4_8:
name: "ubuntu-16.04-gcc-4.8"
runs-on: ubuntu-16.04
timeout-minutes: 60
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ubuntu-16.04-gcc-4.8-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-16.04-gcc-4.8-ccache-${{github.ref}}-
ubuntu-16.04-gcc-4.8-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
sudo apt update
sudo apt install -y gcc-4.8 g++-4.8 bison flex uuid-dev openssl libcurl4-openssl-dev ccache libpython3-dev liblua5.1-0-dev libssh2-1-dev libsqliteodbc
sudo ln -s /usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so /usr/lib/x86_64-linux-gnu/libsqlite3odbc.so
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-4.8 /usr/bin/g++
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- name: build
run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_RULE_MESSAGES=OFF -DSTRICT_GSL_CHECKS=AUDIT -DENABLE_SQL=ON .. && cmake --build . --parallel 4
- name: test
run: cd build && make test ARGS="--timeout 300 -j2 --output-on-failure"
ubuntu_20_04:
name: "ubuntu-20.04"
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ubuntu-20.04-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-20.04-ccache-${{github.ref}}-
ubuntu-20.04-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache libfl-dev libpcap-dev libboost-all-dev libsqliteodbc flake8
sudo ln -s /usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so /usr/lib/x86_64-linux-gnu/libsqlite3odbc.so
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- name: build
run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DCMAKE_BUILD_TYPE=Release -DENABLE_BUSTACHE=ON -DENABLE_SQL=ON -DENABLE_PCAP=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && make -j4 VERBOSE=1
- name: test
run: cd build && make test ARGS="--timeout 300 -j2 --output-on-failure"
- name: linter
run: cd build && make linter
- name: shellcheck
run: cd build && make shellcheck
- id: flake8_check
run: cd build && make flake8
ubuntu_20_04_all_clang:
name: "ubuntu-20.04-all-clang"
runs-on: ubuntu-20.04
timeout-minutes: 90
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ubuntu-20.04-all-clang-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-20.04-all-clang-ccache-${{github.ref}}-
ubuntu-20.04-all-clang-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache libfl-dev libpcap-dev libboost-all-dev openjdk-8-jdk maven libusb-1.0-0-dev libpng-dev libgps-dev libsqliteodbc
sudo ln -s /usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so /usr/lib/x86_64-linux-gnu/libsqlite3odbc.so
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- name: build
run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DCMAKE_BUILD_TYPE=Release -DENABLE_JNI=ON -DENABLE_SENSORS=ON -DENABLE_OPENWSMAN=ON -DENABLE_OPENCV=ON -DENABLE_MQTT=ON -DENABLE_GPS=ON -DENABLE_USB_CAMERA=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_OPC=ON -DENABLE_SFTP=ON -DENABLE_COAP=ON -DENABLE_PYTHON=ON -DENABLE_SQL=ON -DENABLE_AWS=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. && cmake --build . --parallel 4
- name: test
run: cd build && make test ARGS="--timeout 300 -j8 --output-on-failure"
ubuntu_16_04_all:
name: "ubuntu-16.04-all"
runs-on: ubuntu-16.04
timeout-minutes: 90
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ubuntu-16.04-all-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-16.04-all-ccache-${{github.ref}}-
ubuntu-16.04-all-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
sudo apt update
sudo apt install -y ccache openjdk-8-jdk maven libusb-1.0-0-dev libpng12-dev libgps-dev libsqliteodbc
sudo ln -s /usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so /usr/lib/x86_64-linux-gnu/libsqlite3odbc.so
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- name: build
run: sudo mount tmpfs -t tmpfs /tmp && ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DENABLE_OPENWSMAN=ON -DENABLE_OPENCV=ON -DENABLE_GPS=ON -DENABLE_USB_CAMERA=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_OPC=ON -DENABLE_SFTP=ON -DENABLE_MQTT=ON -DENABLE_COAP=ON -DENABLE_PYTHON=ON -DENABLE_SQL=ON -DENABLE_AWS=ON -DENABLE_AZURE=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && cmake --build . --parallel 4
- name: test
run: cd build && make test ARGS="--timeout 300 -j8 --output-on-failure"
debian:
name: "debian"
runs-on: ubuntu-18.04
timeout-minutes: 60
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: debian-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
debian-ccache-${{github.ref}}-
debian-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- id: build
run: mkdir -p build && cd build && cmake -DSTRICT_GSL_CHECKS=AUDIT .. && make debian
centos:
name: "centos"
runs-on: ubuntu-18.04
timeout-minutes: 60
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: centos-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
centos-ccache-${{github.ref}}-
centos-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- id: build
run: mkdir -p build && cd build && cmake -DSTRICT_GSL_CHECKS=AUDIT .. && make centos
fedora:
name: "fedora"
runs-on: ubuntu-18.04
timeout-minutes: 60
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: fedora-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
fedora-ccache-${{github.ref}}-
fedora-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- id: build
run: mkdir -p build && cd build && cmake -DSTRICT_GSL_CHECKS=AUDIT .. && make fedora
ubuntu_18_04:
name: "ubuntu-18.04"
runs-on: ubuntu-18.04
timeout-minutes: 60
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ubuntu-18.04-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-18.04-ccache-${{github.ref}}-
ubuntu-18.04-ccache-refs/heads/main
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- id: build
run: mkdir -p build && cd build && cmake -DSTRICT_GSL_CHECKS=AUDIT .. && make u18
ubuntu_16_04_shared:
name: "ubuntu-16.04-shared"
runs-on: ubuntu-16.04
timeout-minutes: 60
steps:
- id: checkout
uses: actions/checkout@v2
- id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ubuntu-16.04-shared-ccache-${{github.ref}}-${{github.sha}}
restore-keys: |
ubuntu-16.04-shared-ccache-${{github.ref}}-
ubuntu-16.04-shared-ccache-refs/heads/main-
- id: install_deps
run: |
sudo apt update
sudo apt install -y ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null
- id: build
run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS=ON -DSTRICT_GSL_CHECKS=AUDIT .. && cmake --build . --parallel 4 && make test ARGS="--timeout 300 -j4 --output-on-failure"
docker_integration_tests:
name: "Docker integration tests"
runs-on: ubuntu-20.04
timeout-minutes: 90
steps:
- id: checkout
uses: actions/checkout@v2
- id: build
run: ./bootstrap.sh -e -t && cd build && cmake -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DENABLE_JNI=OFF -DDISABLE_JEMALLOC=ON -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_AZURE=ON .. && make docker
- id: install_deps
run: |
sudo apt update
sudo apt install -y python3-virtualenv
- id: test
run: cd build && make docker-verify