This is an automated email from the ASF dual-hosted git repository.

fgerlits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 9c3cdeca2974a7cd4eacb5dad4a4f86890341f00
Author: Marton Szasz <sza...@apache.org>
AuthorDate: Wed May 24 16:05:55 2023 +0200

    MINIFICPP-2126 reenable Windows CI caching
    
    Signed-off-by: Ferenc Gerlits <fgerl...@gmail.com>
    This closes #1580
---
 .github/workflows/ci.yml | 24 ++++++++++++++++++------
 win_build_vs.bat         |  4 +++-
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2d912495f..d87303085 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -4,6 +4,7 @@ env:
   DOCKER_CMAKE_FLAGS: -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT 
-DCI_BUILD=ON -DDISABLE_JEMALLOC=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 -DDOCKER_BUILD_ONLY=ON 
-DDOCKER_CCACHE_DUMP_LOCATION=$HOME/.ccache
+  SCCACHE_GHA_ENABLE: true
 jobs:
   macos_xcode:
     name: "macos-xcode"
@@ -73,8 +74,19 @@ jobs:
         run: git config --system core.longpaths true
       - id: checkout
         uses: actions/checkout@v3
-      - name: Set up MSBuild
-        uses: microsoft/setup-msbuild@v1.1
+      - name: Run sccache-cache
+        uses: mozilla-actions/sccache-action@v0.0.3
+      - name: sccache cache
+        uses: actions/cache@v3
+        with:
+          path: ~/AppData/Local/Mozilla/sccache/cache
+          key: ${{ runner.os }}-sccache-${{ github.ref }}-${{ github.sha }}
+          restore-keys: |
+            ${{ runner.os }}-sccache-${{ github.ref }}
+            ${{ runner.os }}-sccache-refs/heads/main
+            ${{ runner.os }}-sccache
+      - name: Install ninja-build tool
+        uses: seanmiddleditch/gha-setup-ninja@v3
       - name: Set up Python
         uses: actions/setup-python@v4
         with:
@@ -88,15 +100,15 @@ jobs:
         shell: powershell
       - 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 ..\b /64 /CI /S /A /PDH /SPLUNK /GCP /ELASTIC /K /L 
/R /Z /N /RO /PR /PYTHON_SCRIPTING /LUA_SCRIPTING /MQTT
+          for /f "usebackq delims=" %%i in (`vswhere.exe -latest -property 
installationPath`) do if exist "%%i\Common7\Tools\vsdevcmd.bat" call 
"%%i\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64
+          win_build_vs.bat ..\b /64 /CI /S /A /PDH /SPLUNK /GCP /ELASTIC /K /L 
/R /Z /N /RO /PR /PYTHON_SCRIPTING /LUA_SCRIPTING /MQTT /SCCACHE /NINJA
+          sccache --show-stats
         shell: cmd
       - name: test
         run: cd ..\b && ctest --timeout 300 --parallel %NUMBER_OF_PROCESSORS% 
-C Release --output-on-failure
         shell: cmd
       - name: linter
-        run: cd ..\b && msbuild /verbosity:quiet -maxCpuCount linter.vcxproj
+        run: cd ..\b && cmake --build . --target linter --config Release -j 8
         shell: cmd
   ubuntu_20_04:
     name: "ubuntu-20.04"
diff --git a/win_build_vs.bat b/win_build_vs.bat
index bec5cfcb6..b61db5cfd 100755
--- a/win_build_vs.bat
+++ b/win_build_vs.bat
@@ -56,6 +56,7 @@ set build_nanofi=OFF
 set build_opencv=OFF
 set build_prometheus=OFF
 set real_odbc=OFF
+set sccache_arg=
 
 set arg_counter=0
 for %%x in (%*) do (
@@ -100,6 +101,7 @@ for %%x in (%*) do (
     if [%%~x] EQU [/NONFREEUCRT]      set 
"redist=-DMSI_REDISTRIBUTE_UCRT_NONASL=ON"
     if [%%~x] EQU [/RO]               set real_odbc=ON
     if [%%~x] EQU [/NINJA]            set generator="Ninja"
+    if [%%~x] EQU [/SCCACHE]          set 
"sccache_arg=-DCMAKE_C_COMPILER_LAUNCHER=sccache 
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
 )
 
 mkdir %builddir%
@@ -121,7 +123,7 @@ cmake -G %generator% %build_platform_cmd% 
-DINSTALLER_MERGE_MODULES=%installer_m
         -DENABLE_MQTT=%enable_mqtt% -DENABLE_OPC=%enable_opc% 
-DENABLE_OPENWSMAN=%enable_openwsman% -DENABLE_OPS=%enable_ops% 
-DENABLE_PCAP=%enable_pcap% ^
         -DENABLE_PYTHON_SCRIPTING=%enable_python_scripting% 
-DENABLE_SENSORS=%enable_sensors% -DENABLE_TENSORFLOW=%enable_tensorflow% 
-DENABLE_USB_CAMERA=%enable_usb_camera% ^
         -DBUILD_ROCKSDB=ON -DFORCE_WINDOWS=ON -DUSE_SYSTEM_UUID=OFF 
-DDISABLE_LIBARCHIVE=OFF -DENABLE_WEL=ON -DFAIL_ON_WARNINGS=OFF 
-DSKIP_TESTS=%skiptests% ^
-        %strict_gsl_checks% %redist% %EXTRA_CMAKE_ARGUMENTS% "%scriptdir%" && 
%buildcmd%
+        %strict_gsl_checks% %redist% %sccache_arg% %EXTRA_CMAKE_ARGUMENTS% 
"%scriptdir%" && %buildcmd%
 IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
 if [%cpack%] EQU [ON] (
     cpack -C %cmake_build_type%

Reply via email to