diff --git a/.github/actions/cryptopp/action.yaml b/.github/actions/cryptopp/action.yaml index 700014184..4ae4a3ff5 100644 --- a/.github/actions/cryptopp/action.yaml +++ b/.github/actions/cryptopp/action.yaml @@ -26,7 +26,7 @@ runs: steps: - id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: ${{ runner.os }}-cryptopp-${{ inputs.version }}-${{ inputs.architecture }}-${{ inputs.runtime }}-${{ inputs.toolset }} path: | @@ -71,10 +71,10 @@ runs: - name: Build if: steps.cache.outputs.cache-hit != 'true' run: | - msbuild cryptlib.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} - msbuild cryptdll.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} - msbuild cryptlib.vcxproj /p:Configuration=Debug /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} - msbuild cryptdll.vcxproj /p:Configuration=Debug /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} + msbuild cryptlib.vcxproj /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} + msbuild cryptdll.vcxproj /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} + msbuild cryptlib.vcxproj /m /p:Configuration=Debug /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} + msbuild cryptdll.vcxproj /m /p:Configuration=Debug /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} working-directory: tmp/cryptopp shell: cmd diff --git a/.github/actions/google-test/action.yml b/.github/actions/google-test/action.yml index ba0b2f107..55efda483 100644 --- a/.github/actions/google-test/action.yml +++ b/.github/actions/google-test/action.yml @@ -28,11 +28,6 @@ outputs: runs: using: composite steps: - - name: Clone Google Test - working-directory: tmp - shell: bash - run: | - git clone --depth 1 --branch release-${{ inputs.version }} https://github.com/google/googletest.git - id: setup run: | if ("${{ inputs.architecture }}" -eq "x64") { @@ -45,20 +40,35 @@ runs: } else { echo "shared_libs=FALSE" >> $env:GITHUB_OUTPUT } - - shell: pwsh - - name: Build Google Test + + - id: cache + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-googletest-${{ inputs.version }}-${{ inputs.architecture }}-${{ inputs.runtime }}-${{ inputs.toolset }} + path: | + tmp/googletest/install + + - name: Clone Google Test + if: steps.cache.outputs.cache-hit != 'true' + working-directory: tmp + shell: bash + run: | + git clone --depth 1 --branch release-${{ inputs.version }} https://github.com/google/googletest.git + + - name: Configure Google Test + if: steps.cache.outputs.cache-hit != 'true' working-directory: tmp/googletest shell: cmd run: | cmake -S . -G "Visual Studio 17" -B build -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=${{ steps.setup.outputs.shared_libs }} -T ${{ inputs.toolset }} -A ${{ steps.setup.outputs.platform }} - name: Build Google Test + if: steps.cache.outputs.cache-hit != 'true' working-directory: tmp/googletest shell: cmd run: | - msbuild build\INSTALL.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} + msbuild build\INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} - name: Copy Google Test dlls if: ${{ steps.setup.outputs.shared_libs == 'TRUE' }} diff --git a/.github/actions/lua/action.yaml b/.github/actions/lua/action.yaml index 57db6a326..47cc2451c 100644 --- a/.github/actions/lua/action.yaml +++ b/.github/actions/lua/action.yaml @@ -16,7 +16,7 @@ runs: using: composite steps: - id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: ${{ runner.os }}-lua-${{ inputs.version }} path: | diff --git a/.github/actions/openssl/action.yaml b/.github/actions/openssl/action.yaml index c571d4473..6e3950f64 100644 --- a/.github/actions/openssl/action.yaml +++ b/.github/actions/openssl/action.yaml @@ -45,7 +45,7 @@ runs: shell: cmd - id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: ${{ runner.os }}-openssl-${{ inputs.version }}-no-shared-${{ inputs.architecture }}-${{ inputs.runtime }} path: | diff --git a/.github/actions/protobuf/action.yaml b/.github/actions/protobuf/action.yaml index 09b676c06..ad3538d7d 100644 --- a/.github/actions/protobuf/action.yaml +++ b/.github/actions/protobuf/action.yaml @@ -36,7 +36,7 @@ runs: shell: cmd - id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: key: ${{ runner.os }}-protobuf-${{ inputs.version }}-${{ inputs.architecture }}-${{ inputs.runtime }}-${{ inputs.toolset }} path: | @@ -82,10 +82,10 @@ runs: - name: Build run: | - echo msbuild libprotobuf.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} ${{ steps.setup.outputs.vctools_version }} ${{ steps.setup.outputs.additional_options }} - msbuild libprotobuf.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} ${{ steps.setup.outputs.vctools_version }} ${{ steps.setup.outputs.additional_options }} - msbuild libprotoc.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} ${{ steps.setup.outputs.vctools_version }} - msbuild protoc.vcxproj /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} ${{ steps.setup.outputs.vctools_version }} + echo msbuild libprotobuf.vcxproj /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} ${{ steps.setup.outputs.vctools_version }} ${{ steps.setup.outputs.additional_options }} + msbuild libprotobuf.vcxproj /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} ${{ steps.setup.outputs.vctools_version }} ${{ steps.setup.outputs.additional_options }} + msbuild libprotoc.vcxproj /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} ${{ steps.setup.outputs.vctools_version }} + msbuild protoc.vcxproj /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} /p:PlatformToolset=${{ inputs.toolset }} ${{ steps.setup.outputs.vctools_version }} working-directory: tmp/protobuf-${{ inputs.version }}/build shell: cmd if: ${{ steps.cache.outputs.cache-hit != 'true' }} diff --git a/.github/workflows/build-debian.yml b/.github/workflows/build-debian.yml index 77113cf3b..d0d773139 100644 --- a/.github/workflows/build-debian.yml +++ b/.github/workflows/build-debian.yml @@ -118,7 +118,7 @@ jobs: - name: Build nsclient working-directory: tmp/nscp run: | - make + make -j$(nproc) - name: CPack working-directory: tmp/nscp diff --git a/.github/workflows/build-redhat.yml b/.github/workflows/build-redhat.yml index d7e05f2c8..4ae31d3f8 100644 --- a/.github/workflows/build-redhat.yml +++ b/.github/workflows/build-redhat.yml @@ -135,7 +135,7 @@ jobs: - name: Build nsclient working-directory: tmp/nscp run: | - make + make -j$(nproc) - name: CPack working-directory: tmp/nscp diff --git a/.github/workflows/build-windows-legacy.yml b/.github/workflows/build-windows-legacy.yml index 38facf247..6dc0ef131 100644 --- a/.github/workflows/build-windows-legacy.yml +++ b/.github/workflows/build-windows-legacy.yml @@ -155,6 +155,14 @@ jobs: with: version: ${{ ENV.MINIZ_VERSION }} + - name: Cache Boost (static) + id: static_boost_cache + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-boost-legacy-${{ env.BOOST_VERSION }}-${{ inputs.architecture }}-static-runtime-static-msvc141-xp + path: | + ${{ runner.workspace }}/static_boost + - name: Build Boost (static) id: static_boost uses: mickem/build-boost@42c59d10fc12f919a986f7e1c2f7c752d4960190 @@ -220,7 +228,7 @@ jobs: - name: Build installer_lib working-directory: tmp/installer_lib run: | - msbuild installer_lib.sln /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} + msbuild installer_lib.sln /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} - name: CMake (NSCP) working-directory: tmp/nscp @@ -230,7 +238,7 @@ jobs: - name: Build nsclient working-directory: tmp/nscp run: | - msbuild NSCP.sln /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} + msbuild NSCP.sln /m /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} - name: Run tests working-directory: tmp/nscp @@ -248,7 +256,7 @@ jobs: - name: Build installer working-directory: tmp/nscp run: | - msbuild installers\installer-NSCP\installer_NSCP.vcxproj /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} /p:BuildProjectReferences=false + msbuild installers\installer-NSCP\installer_NSCP.vcxproj /m /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} /p:BuildProjectReferences=false - name: Post process files uses: ./.github/actions/post-process-windows-binaries diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 2c62e4f3b..19a89b3f8 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -178,6 +178,14 @@ jobs: with: version: ${{ ENV.MINIZ_VERSION }} + - name: Cache Boost (static) + id: static_boost_cache + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-boost-${{ env.BOOST_VERSION }}-${{ inputs.architecture }}-static-runtime-static-libs-system_filesystem-${{ steps.setup.outputs.toolset }} + path: | + ${{ runner.workspace }}/static_boost + - name: Build Boost (static) id: static_boost uses: mickem/build-boost@v1 @@ -190,6 +198,14 @@ jobs: static-runtime: 1 directory: ${{ runner.workspace }}/static_boost + - name: Cache Boost (regular) + id: boost_cache + uses: actions/cache@v4 + with: + key: ${{ runner.os }}-boost-${{ env.BOOST_VERSION }}-${{ inputs.architecture }}-shared-runtime-shared-libs-full-${{ steps.setup.outputs.toolset }} + path: | + ${{ runner.workspace }}/boost + - name: Build Boost (regular) id: boost uses: mickem/build-boost@v1 @@ -256,7 +272,7 @@ jobs: - name: Build installer_lib working-directory: tmp/installer_lib run: | - msbuild installer_lib.sln /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} + msbuild installer_lib.sln /m /p:Configuration=Release /p:Platform=${{ steps.setup.outputs.platform }} - name: CMake (NSCP) working-directory: tmp/nscp @@ -266,7 +282,7 @@ jobs: - name: Build nsclient working-directory: tmp/nscp run: | - msbuild NSCP.sln /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} + msbuild NSCP.sln /m /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} - name: Run tests if: inputs.architecture != 'arm64' @@ -285,7 +301,7 @@ jobs: - name: Build installer working-directory: tmp/nscp run: | - msbuild installers\installer-NSCP\installer_NSCP.vcxproj /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} /p:BuildProjectReferences=false + msbuild installers\installer-NSCP\installer_NSCP.vcxproj /m /p:Configuration=RelWithDebInfo /p:Platform=${{ steps.setup.outputs.platform }} /p:BuildProjectReferences=false - name: Post process files uses: ./.github/actions/post-process-windows-binaries diff --git a/.github/workflows/tests-sanitizers.yml b/.github/workflows/tests-sanitizers.yml index 49bc310e1..5060f6f22 100644 --- a/.github/workflows/tests-sanitizers.yml +++ b/.github/workflows/tests-sanitizers.yml @@ -41,14 +41,25 @@ jobs: steps: - name: Install dependencies + # archive.ubuntu.com periodically drops connections mid-fetch, which + # bricks CI for transient reasons. Configure apt to retry each package + # itself, and then wrap the whole step in a shell-level retry loop so a + # full mirror outage can be ridden out without re-running the workflow. run: | - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get install -y \ - git curl unzip cmake build-essential python3-pip \ - libboost-all-dev libgtest-dev libgmock-dev \ - protobuf-compiler libprotobuf-dev \ - openssl libssl-dev libcrypto++-dev \ - liblua5.4-dev libdbus-1-dev + echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries + echo 'Acquire::http::Timeout "30";' >> /etc/apt/apt.conf.d/80-retries + echo 'Acquire::https::Timeout "30";' >> /etc/apt/apt.conf.d/80-retries + for attempt in 1 2 3; do + apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing \ + git curl unzip cmake build-essential python3-pip \ + libboost-all-dev libgtest-dev libgmock-dev \ + protobuf-compiler libprotobuf-dev \ + openssl libssl-dev libcrypto++-dev \ + liblua5.4-dev libdbus-1-dev && break + echo "apt attempt $attempt failed, retrying in 30s..." + sleep 30 + done - uses: actions/checkout@v6