MINIFICPP-2494 windows event log: fix event message formatting, refactor #5739
Workflow file for this run
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: "MiNiFi-CPP CI" | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \ | |
-DENABLE_SPLUNK=ON -DENABLE_GCP=ON -DENABLE_OPC=ON -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_TEST_PROCESSORS=ON -DENABLE_PROMETHEUS=ON \ | |
-DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DDOCKER_BUILD_ONLY=ON | |
SCCACHE_GHA_ENABLE: true | |
CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache | |
jobs: | |
macos_xcode: | |
name: "macos-xcode" | |
runs-on: macos-14 | |
timeout-minutes: 180 | |
env: | |
MACOS_MINIFI_OPTIONS: >- | |
-DCMAKE_BUILD_TYPE=Release | |
-DCI_BUILD=ON | |
-DCUSTOM_MALLOC=OFF | |
-DDOCKER_BUILD_ONLY=OFF | |
-DDOCKER_PUSH=OFF | |
-DDOCKER_SKIP_TESTS=ON | |
-DENABLE_ALL=OFF | |
-DENABLE_AWS=ON | |
-DENABLE_AZURE=ON | |
-DENABLE_BUSTACHE=OFF | |
-DENABLE_BZIP2=ON | |
-DENABLE_CIVET=ON | |
-DENABLE_CONTROLLER=ON | |
-DENABLE_ELASTICSEARCH=ON | |
-DENABLE_ENCRYPT_CONFIG=ON | |
-DENABLE_EXPRESSION_LANGUAGE=ON | |
-DENABLE_GCP=ON | |
-DENABLE_KUBERNETES=ON | |
-DENABLE_LIBARCHIVE=ON | |
-DENABLE_LIBRDKAFKA=ON | |
-DENABLE_LUA_SCRIPTING=ON | |
-DENABLE_LZMA=ON | |
-DENABLE_MQTT=ON | |
-DENABLE_OPC=ON | |
-DENABLE_OPENCV=ON | |
-DENABLE_OPS=ON | |
-DENABLE_PROMETHEUS=ON | |
-DENABLE_PYTHON_SCRIPTING=ON | |
-DENABLE_ROCKSDB=ON | |
-DENABLE_SFTP=OFF | |
-DENABLE_SPLUNK=ON | |
-DENABLE_SQL=ON | |
-DENABLE_TEST_PROCESSORS=OFF | |
-DFORCE_COLORED_OUTPUT=OFF | |
-DLIBC_STATIC=OFF | |
-DMINIFI_ADVANCED_ASAN_BUILD=OFF | |
-DMINIFI_ADVANCED_CODE_COVERAGE=OFF | |
-DMINIFI_FAIL_ON_WARNINGS=OFF | |
-DMINIFI_USE_REAL_ODBC_TEST_DRIVER=ON | |
-DPORTABLE=ON | |
-DSKIP_TESTS=OFF | |
-DUSE_SHARED_LIBS=ON | |
steps: | |
- id: checkout | |
uses: actions/checkout@v4 | |
- name: cache restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: macos-arm-xcode-ccache-${{github.ref}}-${{github.sha}} | |
restore-keys: | | |
macos-arm-xcode-ccache-${{github.ref}}- | |
macos-arm-xcode-ccache-refs/heads/main- | |
- id: install_dependencies | |
run: | | |
brew update | |
brew install ossp-uuid bison flex ccache sqliteodbc automake autoconf ninja | |
- id: setup_env | |
name: setup enviroment | |
run: | | |
echo "PATH=/opt/homebrew/opt/ccache:/opt/homebrew/opt/ccache/bin:/opt/homebrew/opt/ccache/libexec:$PATH" >> $GITHUB_ENV | |
echo "DYLD_LIBRARY_PATH=$(brew --prefix)/lib" >> $GITHUB_ENV | |
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null | |
- name: build | |
run: | | |
python -m venv venv && source venv/bin/activate && pip install -r requirements.txt && python main.py --noninteractive --skip-compiler-install --cmake-options="-DCMAKE_C_FLAGS=${CPPFLAGS} ${CFLAGS} -DCMAKE_CXX_FLAGS=${CPPFLAGS} ${CXXFLAGS}" --minifi-options="${MACOS_MINIFI_OPTIONS}" | |
working-directory: bootstrap | |
- name: cache save | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: macos-arm-xcode-ccache-${{github.ref}}-${{github.sha}} | |
- name: test | |
id: test | |
run: | | |
# Set core file size limit to unlimited | |
ulimit -c unlimited | |
ctest -j4 --output-on-failure --timeout 300 | |
working-directory: build | |
- name: linter | |
run: ninja linter | |
working-directory: build | |
- name: check-cores | |
if: ${{ failure() && steps.test.conclusion == 'failure' }} | |
run: | | |
if [ "$(ls -A /cores)" ]; then echo "CORES_EXIST=true" >> $GITHUB_ENV; fi | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() && env.CORES_EXIST == 'true' }} | |
with: | |
name: macos-coredumps | |
path: /cores | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() && env.CORES_EXIST == 'true' }} | |
with: | |
name: macos-binaries | |
path: build/bin | |
windows_VS2022: | |
name: "windows-2022" | |
runs-on: windows-2022 | |
timeout-minutes: 240 | |
env: | |
WINDOWS_MINIFI_OPTIONS: >- | |
-DCMAKE_BUILD_TYPE=Release | |
-DBUILD_ROCKSDB=ON | |
-DBUILD_SHARED_LIBS=OFF | |
-DCI_BUILD=ON | |
-DCUSTOM_MALLOC=OFF | |
-DDOCKER_BUILD_ONLY=OFF | |
-DDOCKER_PUSH=OFF | |
-DDOCKER_SKIP_TESTS=ON | |
-DENABLE_ALL=OFF | |
-DENABLE_AWS=ON | |
-DENABLE_AZURE=ON | |
-DENABLE_BUSTACHE=OFF | |
-DENABLE_BZIP2=ON | |
-DENABLE_CIVET=ON | |
-DENABLE_CONTROLLER=ON | |
-DENABLE_COVERAGE= | |
-DENABLE_ELASTICSEARCH=ON | |
-DENABLE_ENCRYPT_CONFIG=ON | |
-DENABLE_EXPRESSION_LANGUAGE=ON | |
-DENABLE_GCP=ON | |
-DENABLE_GRAFANA_LOKI=ON | |
-DENABLE_KUBERNETES=ON | |
-DENABLE_LIBARCHIVE=ON | |
-DENABLE_LIBRDKAFKA=ON | |
-DENABLE_LUA_SCRIPTING=ON | |
-DENABLE_LZMA=ON | |
-DENABLE_MQTT=ON | |
-DENABLE_OPC=ON | |
-DENABLE_OPENCV=OFF | |
-DENABLE_OPS=ON | |
-DENABLE_PDH=ON | |
-DENABLE_PROMETHEUS=ON | |
-DENABLE_PYTHON_SCRIPTING=ON | |
-DENABLE_ROCKSDB=ON | |
-DENABLE_SFTP=OFF | |
-DENABLE_SMB=ON | |
-DENABLE_SPLUNK=ON | |
-DENABLE_SQL=ON | |
-DENABLE_TEST_PROCESSORS=OFF | |
-DENABLE_WEL=ON | |
-DFORCE_COLORED_OUTPUT=ON | |
-DINSTALLER_MERGE_MODULES=OFF | |
-DMINIFI_FAIL_ON_WARNINGS=ON | |
-DMSI_REDISTRIBUTE_UCRT_NONASL=OFF | |
-DPORTABLE=ON | |
-DSKIP_TESTS=OFF | |
-DSTATIC_BUILD=ON | |
-DMINIFI_USE_REAL_ODBC_TEST_DRIVER=ON | |
-DUSE_SHARED_LIBS=OFF | |
steps: | |
- name: Support longpaths | |
run: git config --system core.longpaths true | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Restore cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/AppData/Local/Mozilla/sccache/cache | |
key: ${{ runner.os }}-2022-sccache-${{ github.ref }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-2022-sccache-${{ github.ref }} | |
${{ runner.os }}-2022-sccache-refs/heads/main | |
${{ runner.os }}-2022-sccache | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Set up Python | |
run: choco -y install python & refreshenv | |
shell: cmd | |
- name: Install sqliteodbc driver | |
run: | | |
Invoke-WebRequest -Uri "http://www.ch-werner.de/sqliteodbc/sqliteodbc_w64.exe" -OutFile "sqliteodbc_w64.exe" | |
if ((Get-FileHash 'sqliteodbc_w64.exe').Hash -ne "a4804e4f54f42c721df1323c5fcac101a8c7a577e7f20979227324ceab572d51") {Write "Hash mismatch"; Exit 1} | |
Start-Process -FilePath ".\sqliteodbc_w64.exe" -ArgumentList "/S" -Wait | |
shell: powershell | |
- name: Add sccache to path | |
run: '[Environment]::SetEnvironmentVariable("PATH", [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + ";" + (Split-Path -Path $env:SCCACHE_PATH -Parent), [EnvironmentVariableTarget]::Machine);' | |
shell: powershell | |
- name: Install jom | |
run: | | |
Invoke-WebRequest -Uri "http://download.qt.io/official_releases/jom/jom_1_1_4.zip" -OutFile "jom.zip" | |
if ((Get-FileHash 'jom.zip').Hash -ne "d533c1ef49214229681e90196ed2094691e8c4a0a0bef0b2c901debcb562682b") {Write "Hash mismatch"; Exit 1} | |
New-Item -ItemType Directory -Path D:\jom | |
Expand-Archive -Path jom.zip -DestinationPath D:\jom | |
[Environment]::SetEnvironmentVariable("PATH", [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::Machine) + ";D:\jom", [EnvironmentVariableTarget]::Machine); | |
shell: powershell | |
- name: build | |
run: | | |
python -m venv venv & venv\Scripts\activate & pip install -r requirements.txt & python main.py --noninteractive --skip-compiler-install --minifi-options="%WINDOWS_MINIFI_OPTIONS%" --cmake-options="-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" | |
shell: cmd | |
working-directory: bootstrap | |
- name: Save cache | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ~/AppData/Local/Mozilla/sccache/cache | |
key: ${{ runner.os }}-2022-sccache-${{ github.ref }}-${{ github.sha }} | |
- name: Run tests | |
run: ctest --timeout 300 --parallel %NUMBER_OF_PROCESSORS% -C Release --output-on-failure | |
shell: cmd | |
working-directory: ./build | |
- name: Run linter | |
run: cmake --build . --target linter --config Release -j 8 | |
shell: cmd | |
working-directory: ./build | |
- name: Upload artifact | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cpack_error | |
path: D:/a/nifi-minifi-cpp/nifi-minifi-cpp/build/_CPack_Packages/win64/WIX/wix.log | |
ubuntu_24_04: | |
name: "ubuntu-24.04" | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 120 | |
env: | |
UBUNTU_GCC_MINIFI_OPTIONS: >- | |
-DCMAKE_BUILD_TYPE=Release | |
-DCI_BUILD=OFF | |
-DCUSTOM_MALLOC=OFF | |
-DDOCKER_BUILD_ONLY=OFF | |
-DDOCKER_PUSH=OFF | |
-DDOCKER_SKIP_TESTS=ON | |
-DENABLE_ALL=OFF | |
-DENABLE_AWS=OFF | |
-DENABLE_AZURE=OFF | |
-DENABLE_BUSTACHE=ON | |
-DENABLE_BZIP2=ON | |
-DENABLE_CIVET=ON | |
-DENABLE_CONTROLLER=ON | |
-DENABLE_ELASTICSEARCH=OFF | |
-DENABLE_ENCRYPT_CONFIG=ON | |
-DENABLE_EXPRESSION_LANGUAGE=ON | |
-DENABLE_GCP=OFF | |
-DENABLE_KUBERNETES=OFF | |
-DENABLE_LIBARCHIVE=ON | |
-DENABLE_LIBRDKAFKA=OFF | |
-DENABLE_LUA_SCRIPTING=OFF | |
-DENABLE_LZMA=ON | |
-DENABLE_MQTT=OFF | |
-DENABLE_OPC=OFF | |
-DENABLE_OPENCV=OFF | |
-DENABLE_OPS=ON | |
-DENABLE_PROCFS=OFF | |
-DENABLE_PROMETHEUS=ON | |
-DENABLE_PYTHON_SCRIPTING=OFF | |
-DENABLE_ROCKSDB=ON | |
-DENABLE_SFTP=ON | |
-DENABLE_SPLUNK=OFF | |
-DENABLE_SQL=OFF | |
-DENABLE_SYSTEMD=ON | |
-DENABLE_TEST_PROCESSORS=OFF | |
-DFORCE_COLORED_OUTPUT=ON | |
-DMINIFI_FAIL_ON_WARNINGS=ON | |
-DPORTABLE=ON | |
-DSKIP_TESTS=OFF | |
-DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF | |
-DUSE_SHARED_LIBS=ON | |
steps: | |
- id: checkout | |
uses: actions/checkout@v4 | |
- name: cache restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ubuntu-24.04-ccache-${{github.ref}}-${{github.sha}} | |
restore-keys: | | |
ubuntu-24.04-ccache-${{github.ref}}- | |
ubuntu-24.04-ccache-refs/heads/main- | |
- id: install_deps | |
run: | | |
sudo apt update | |
sudo apt install -y ccache libfl-dev python3 python3-venv | |
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: | | |
python3 -m venv venv && source venv/bin/activate \ | |
&& pip install -r requirements.txt \ | |
&& python main.py --noninteractive --minifi-options="${UBUNTU_GCC_MINIFI_OPTIONS}" --cmake-options="-DSTRICT_GSL_CHECKS=AUDIT" | |
working-directory: bootstrap | |
- name: cache save | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ubuntu-24.04-ccache-${{github.ref}}-${{github.sha}} | |
- name: test | |
id: test | |
run: | | |
# Set core file size limit to unlimited | |
ulimit -c unlimited | |
ctest -j$(nproc) --output-on-failure | |
working-directory: build | |
- name: check-cores | |
if: ${{ failure() && steps.test.conclusion == 'failure' }} | |
run: | | |
if [ "$(ls -A /var/lib/apport/coredump/)" ]; then echo "CORES_EXIST=true" >> $GITHUB_ENV; fi | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() && env.CORES_EXIST == 'true' }} | |
with: | |
name: ubuntu-coredumps | |
path: /var/lib/apport/coredump/ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() && env.CORES_EXIST == 'true' }} | |
with: | |
name: ubuntu-binaries | |
path: build/bin | |
ubuntu_22_04_clang: | |
name: "ubuntu-22.04-clang" | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 240 | |
env: | |
UBUNTU_CLANG_MINIFI_OPTIONS: >- | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo | |
-DCI_BUILD=OFF | |
-DCUSTOM_MALLOC=OFF | |
-DDOCKER_BUILD_ONLY=OFF | |
-DDOCKER_PUSH=OFF | |
-DDOCKER_SKIP_TESTS=ON | |
-DENABLE_ALL=OFF | |
-DENABLE_AWS=ON | |
-DENABLE_AZURE=ON | |
-DENABLE_BUSTACHE=ON | |
-DENABLE_BZIP2=ON | |
-DENABLE_CIVET=ON | |
-DENABLE_CONTROLLER=ON | |
-DENABLE_ELASTICSEARCH=ON | |
-DENABLE_ENCRYPT_CONFIG=ON | |
-DENABLE_EXPRESSION_LANGUAGE=ON | |
-DENABLE_EXECUTE_PROCESS=ON | |
-DENABLE_GCP=ON | |
-DENABLE_GRAFANA_LOKI=ON | |
-DENABLE_KUBERNETES=ON | |
-DENABLE_LIBARCHIVE=ON | |
-DENABLE_LIBRDKAFKA=ON | |
-DENABLE_LUA_SCRIPTING=ON | |
-DENABLE_LZMA=ON | |
-DENABLE_MQTT=ON | |
-DENABLE_OPC=ON | |
-DENABLE_OPENCV=ON | |
-DENABLE_OPS=ON | |
-DENABLE_PROCFS=ON | |
-DENABLE_PROMETHEUS=ON | |
-DENABLE_PYTHON_SCRIPTING=ON | |
-DENABLE_ROCKSDB=ON | |
-DENABLE_SFTP=ON | |
-DENABLE_SPLUNK=ON | |
-DENABLE_SQL=ON | |
-DENABLE_SYSTEMD=ON | |
-DENABLE_TEST_PROCESSORS=OFF | |
-DFORCE_COLORED_OUTPUT=ON | |
-DMINIFI_FAIL_ON_WARNINGS=ON | |
-DPORTABLE=ON | |
-DSKIP_TESTS=OFF | |
-DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF | |
-DUSE_SHARED_LIBS=ON | |
steps: | |
- id: checkout | |
uses: actions/checkout@v4 | |
- name: cache restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ubuntu-22.04-all-clang-ccache-${{github.ref}}-${{github.sha}} | |
restore-keys: | | |
ubuntu-22.04-all-clang-ccache-${{github.ref}}- | |
ubuntu-22.04-all-clang-ccache-refs/heads/main- | |
- id: install_deps | |
run: | | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | |
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" | sudo tee -a /etc/apt/sources.list | |
echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main" | sudo tee -a /etc/apt/sources.list | |
sudo apt update | |
sudo apt install -y ccache libfl-dev clang-16 clang-tidy-16 libc++-16-dev libc++abi-16-dev libc++1-16 libc++abi1-16 libunwind-16 libsqliteodbc flake8 parallel | |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV | |
echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null | |
- id: free_disk_space | |
run: | | |
# We can gain additional disk space on the Ubuntu runners thanks to these suggestions: | |
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | |
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150 | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: build | |
run: | | |
export CC=clang-16 | |
export CXX=clang++-16 | |
export CXXFLAGS="-stdlib=libc++" | |
export LDFLAGS="-stdlib=libc++" | |
python3 -m venv venv && source venv/bin/activate \ | |
&& pip install -r requirements.txt \ | |
&& python main.py --noninteractive --skip-compiler-install --cmake-options="-DSTRICT_GSL_CHECKS=AUDIT -DCMAKE_EXPORT_COMPILE_COMMANDS=ON" --minifi-options="${UBUNTU_CLANG_MINIFI_OPTIONS}" | |
working-directory: bootstrap | |
- id: cache_save | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ubuntu-22.04-all-clang-ccache-${{github.ref}}-${{github.sha}} | |
- name: test | |
id: test | |
run: | | |
# Set core file size limit to unlimited | |
ulimit -c unlimited | |
ctest -j$(nproc) --output-on-failure | |
working-directory: build | |
- name: linter | |
run: cmake --build . --target linter | |
working-directory: ./build | |
- name: shellcheck | |
run: cmake --build . --target shellcheck | |
working-directory: ./build | |
- id: flake8_check | |
run: cmake --build . --target flake8 | |
working-directory: ./build | |
- id: files | |
uses: Ana06/[email protected] | |
continue-on-error: true | |
- name: clang-tidy | |
run: | | |
if [[ -n "${{ steps.files.outputs.all }}" ]]; then | |
FILES="${{ steps.files.outputs.all }}" | |
else | |
git fetch origin main && git checkout -b main origin/main || true | |
FILES=$(git diff --name-only main ${{ github.sha }} --) | |
git checkout ${{ github.sha }} | |
fi | |
# https://stackoverflow.com/questions/58466701/clang-tidy-cant-locate-stdlib-headers | |
sed -i -e 's/\/usr\/lib\/ccache\/clang++-16/\/lib\/llvm-16\/bin\/clang++/g' build/compile_commands.json | |
sed -i -e 's/\/usr\/lib\/ccache\/clang-16/\/lib\/llvm-16\/bin\/clang/g' build/compile_commands.json | |
sed -i -e 's/\/usr\/lib\/ccache\/c++/\/lib\/llvm-16\/bin\/clang++/g' build/compile_commands.json | |
sed -i -e 's/\/usr\/lib\/ccache\/cc/\/lib\/llvm-16\/bin\/clang/g' build/compile_commands.json | |
parallel -j$(( $(nproc) + 1 )) ./run_clang_tidy.sh ::: ${FILES} | |
- name: check-cores | |
if: ${{ failure() && steps.test.conclusion == 'failure' }} | |
run: | | |
if [ "$(ls -A /var/lib/apport/coredump/)" ]; then echo "CORES_EXIST=true" >> $GITHUB_ENV; fi | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() && env.CORES_EXIST == 'true' }} | |
with: | |
name: ubuntu-clang-coredumps | |
path: /var/lib/apport/coredump/ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() && env.CORES_EXIST == 'true' }} | |
with: | |
name: ubuntu-clang-binaries | |
path: build/bin | |
rocky: | |
name: "rocky" | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 180 | |
steps: | |
- id: checkout | |
uses: actions/checkout@v4 | |
- name: cache restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: rocky-ccache-${{github.ref}}-${{github.sha}} | |
restore-keys: | | |
rocky-ccache-${{github.ref}}- | |
rocky-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: free_disk_space | |
run: | | |
# We can gain additional disk space on the Ubuntu runners thanks to these suggestions: | |
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | |
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150 | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- id: build | |
run: | | |
# rocky build can run out of the github runners' disk space if built with RelWithDebInfo so we keep the Release build here | |
mkdir build && cd build && cmake -DUSE_SHARED_LIBS=ON -DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DSTRICT_GSL_CHECKS=AUDIT -DMINIFI_FAIL_ON_WARNINGS=OFF -DENABLE_AWS=ON -DENABLE_AZURE=ON \ | |
-DENABLE_ENCRYPT_CONFIG=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_OPC=ON -DENABLE_OPENCV=ON -DENABLE_OPS=ON -DENABLE_SQL=ON -DENABLE_SYSTEMD=ON \ | |
-DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_GCP=ON -DENABLE_PROCFS=ON -DENABLE_PROMETHEUS=ON \ | |
-DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DDOCKER_SKIP_TESTS=OFF -DDOCKER_BUILD_ONLY=ON -DDOCKER_CCACHE_DUMP_LOCATION=${{ env.CCACHE_DIR }} .. && make rocky-test | |
- name: cache save | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: rocky-ccache-${{github.ref}}-${{github.sha}} | |
- id: test | |
run: | | |
# Set core file size limit to unlimited | |
ulimit -c unlimited | |
echo '/cores/core.%e.%p' | sudo tee /proc/sys/kernel/core_pattern | |
sudo mkdir /cores | |
sudo chmod 777 /cores | |
docker run --name rocky-test --init --ulimit core=-1 --mount type=bind,source=/cores,target=/cores apacheminificpp:$(docker images | grep apacheminificpp | grep rocky | awk '{print $2}') bash -c 'cd /opt/minifi/build && make test ARGS="--timeout 300 -j8 --output-on-failure"' | |
- name: check-cores | |
if: ${{ failure() && steps.test.conclusion == 'failure' }} | |
run: | | |
if [ "$(ls -A /cores)" ]; then | |
echo "CORES_EXIST=true" >> $GITHUB_ENV; | |
docker cp rocky-test:/opt/minifi/build/bin /tmp | |
sudo chmod -R 777 /cores | |
fi | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() && env.CORES_EXIST == 'true' }} | |
with: | |
name: rocky-crashes | |
path: /cores | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() && env.CORES_EXIST == 'true' }} | |
with: | |
name: rocky-binaries | |
path: /tmp/bin | |
docker_build: | |
name: "Docker build for integration tests" | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 180 | |
steps: | |
- id: checkout | |
uses: actions/checkout@v4 | |
- name: cache restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: docker-ccache-${{github.ref}}-${{github.sha}} | |
restore-keys: | | |
docker-ccache-${{github.ref}}- | |
docker-ccache-refs/heads/main | |
- id: free_disk_space | |
run: | | |
# We can gain additional disk space on the Ubuntu runners thanks to these suggestions: | |
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | |
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150 | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- id: build | |
run: | | |
mkdir build | |
cd build | |
cmake ${DOCKER_CMAKE_FLAGS} -DDOCKER_CCACHE_DUMP_LOCATION=${{ env.CCACHE_DIR }} .. | |
make docker | |
- name: cache save | |
uses: actions/cache/save@v4 | |
if: always() | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: docker-ccache-${{github.ref}}-${{github.sha}} | |
- name: Save docker image | |
run: cd build && docker save -o minifi_docker.tar apacheminificpp:$(grep CMAKE_PROJECT_VERSION:STATIC CMakeCache.txt | cut -d "=" -f2) | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: minifi_docker | |
path: build/minifi_docker.tar | |
docker_tests: | |
name: "Docker integration tests" | |
needs: docker_build | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 180 | |
steps: | |
- id: checkout | |
uses: actions/checkout@v4 | |
- id: run_cmake | |
name: Run CMake | |
run: | | |
mkdir build | |
cd build | |
cmake ${DOCKER_CMAKE_FLAGS} .. | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: minifi_docker | |
path: build | |
- name: Load Docker image | |
run: | | |
docker load --input ./build/minifi_docker.tar | |
- id: install_deps | |
name: Install dependencies for Docker Verify | |
run: | | |
sudo apt update | |
sudo apt install -y python3-virtualenv | |
- id: free_disk_space | |
run: | | |
# We can gain additional disk space on the Ubuntu runners thanks to these suggestions: | |
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | |
# https://github.com/actions/runner-images/issues/2606#issuecomment-772683150 | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- id: test | |
name: Docker Verify | |
working-directory: ./build | |
run: make docker-verify | |
- name: Test Reporter | |
if: always() | |
uses: phoenix-actions/test-reporting@v15 | |
with: | |
name: Docker integration tests | |
path: build/behavex_output/behave/*.xml | |
reporter: java-junit | |
output-to: 'step-summary' | |
only-summary: 'true' | |
list-tests: 'failed' | |
list-suites: 'failed' | |
- name: Upload artifact | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: behavex_output | |
path: build/behavex_output |