Skip to content

use sccache 5

use sccache 5 #3265

Workflow file for this run

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=OFF -DENABLE_GRAFANA_LOKI=ON -DDOCKER_BUILD_ONLY=ON
SCCACHE_GHA_ENABLE: true
CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
jobs:
windows_VS2022:
name: "windows-2022"
runs-on: windows-2022
timeout-minutes: 240
env:
LUA_DIR: D:\a\nifi-minifi-cpp\nifi-minifi-cpp\.lua
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_COAP=OFF
-DENABLE_CONTROLLER=OFF
-DENABLE_COVERAGE=
-DENABLE_CURL=ON
-DENABLE_ELASTICSEARCH=ON
-DENABLE_ENCRYPT_CONFIG=ON
-DENABLE_EXPRESSION_LANGUAGE=ON
-DENABLE_GCP=ON
-DENABLE_GPS=OFF
-DENABLE_GRAFANA_LOKI=ON
-DENABLE_JNI=OFF
-DENABLE_KUBERNETES=ON
-DENABLE_LIBARCHIVE=ON
-DENABLE_LIBRDKAFKA=ON
-DENABLE_LUA_SCRIPTING=OFF
-DENABLE_LZMA=ON
-DENABLE_MQTT=ON
-DENABLE_NANOFI=ON
-DENABLE_OPC=ON
-DENABLE_OPENCV=OFF
-DENABLE_OPENWSMAN=OFF
-DENABLE_OPS=ON
-DENABLE_PCAP=OFF
-DENABLE_PDH=ON
-DENABLE_PROMETHEUS=ON
-DENABLE_PYTHON_SCRIPTING=ON
-DENABLE_ROCKSDB=ON
-DENABLE_SENSORS=OFF
-DENABLE_SFTP=OFF
-DENABLE_SMB=ON
-DENABLE_SPLUNK=ON
-DENABLE_SQL=ON
-DENABLE_TEST_PROCESSORS=OFF
-DENABLE_USB_CAMERA=OFF
-DENABLE_WEL=ON
-DFORCE_COLORED_OUTPUT=ON
-DINSTALLER_MERGE_MODULES=OFF
-DMINIFI_FAIL_ON_WARNINGS=OFF
-DMINIFI_OPENSSL=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@v3
- name: Restore cache
uses: actions/cache/restore@v3
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/sccache-action@v0.0.3
- 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) + ";C:\hostedtoolcache\windows\sccache\0.7.7\x64\", [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@v3
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