Update autobuild.xml #4
This file contains hidden or 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: CI | |
| on: | |
| workflow_call: | |
| push: | |
| branches: [ "**" ] | |
| pull_request: | |
| branches: [ "**" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-test-windows: | |
| name: Build and test (Windows, MSVC) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgGitCommitId: 'c59b04f668d20c7dd83f478835e8266a3cc51270' | |
| - name: Configure CMake (VS 2022, x64, Release) | |
| run: > | |
| cmake -S . -B build | |
| -G "Visual Studio 17 2022" -A x64 | |
| -DENTROPY_ENABLE_TESTS=ON | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build tests (Release) | |
| run: cmake --build build --config Release --target EntropyCoreTests | |
| - name: Run tests (non-timer tests must pass) | |
| working-directory: build | |
| run: ctest -C Release -VV --output-on-failure -E "TimerServiceTest" | |
| - name: Run timer tests (allowed to fail - timing-sensitive on CI) | |
| working-directory: build | |
| run: ctest -C Release -VV --output-on-failure -R "TimerServiceTest" || true | |
| - name: Install package (Release) | |
| run: cmake --install build --config Release --prefix "${{ github.workspace }}\\EntropyCore-Windows-x64" | |
| - name: Build (Debug) | |
| run: cmake --build build --config Debug | |
| - name: Install package (Debug) | |
| run: cmake --install build --config Debug --prefix "${{ github.workspace }}\\EntropyCore-Windows-x64" | |
| - name: Upload CTest logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ctest-logs-windows | |
| path: | | |
| build/Testing/Temporary/LastTest.log | |
| build/Testing/**/Test.xml | |
| build/Testing/Temporary/LastTestsFailed.log | |
| - name: Upload Windows package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: EntropyCore-Windows-x64 | |
| path: EntropyCore-Windows-x64/** | |
| build-and-test-linux: | |
| name: Build and test (Linux, GCC 14) | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install prerequisites | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build gcc-14 g++-14 cmake | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 | |
| sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 100 | |
| sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 100 | |
| gcc --version | |
| g++ --version | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgGitCommitId: 'c59b04f668d20c7dd83f478835e8266a3cc51270' | |
| - name: Configure CMake (Ninja, Release) | |
| run: > | |
| cmake -S . -B build-release -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DENTROPY_ENABLE_TESTS=ON | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build tests (Release) | |
| run: cmake --build build-release --target EntropyCoreTests | |
| - name: Run tests (non-timer tests must pass) | |
| working-directory: build-release | |
| run: ctest -VV --output-on-failure -E "TimerServiceTest" | |
| - name: Run timer tests (allowed to fail - timing-sensitive on CI) | |
| working-directory: build-release | |
| run: ctest -VV --output-on-failure -R "TimerServiceTest" || true | |
| - name: Install package (Release) | |
| run: cmake --install build-release --prefix "${{ github.workspace }}/EntropyCore-Linux-gcc-14" | |
| - name: Configure CMake (Ninja, Debug) | |
| run: > | |
| cmake -S . -B build-debug -G Ninja | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DENTROPY_ENABLE_TESTS=OFF | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build (Debug) | |
| run: cmake --build build-debug | |
| - name: Install package (Debug) | |
| run: cmake --install build-debug --prefix "${{ github.workspace }}/EntropyCore-Linux-gcc-14/debug" | |
| - name: Restructure debug files for vcpkg | |
| run: | | |
| cd "${{ github.workspace }}/EntropyCore-Linux-gcc-14/debug" | |
| rm -rf include share | |
| - name: Upload CTest logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ctest-logs-linux | |
| path: | | |
| build-release/Testing/Temporary/LastTest.log | |
| build-release/Testing/**/Test.xml | |
| build-release/Testing/Temporary/LastTestsFailed.log | |
| - name: Upload Linux GCC package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: EntropyCore-Linux-gcc-14 | |
| path: EntropyCore-Linux-gcc-14/** | |
| build-and-test-macos: | |
| name: Build and test (macOS, AppleClang) | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install prerequisites | |
| run: | | |
| brew update | |
| brew install ninja | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgGitCommitId: 'c59b04f668d20c7dd83f478835e8266a3cc51270' | |
| # Build x64 Release | |
| - name: Configure CMake (Ninja, Release, x64) | |
| run: > | |
| cmake -S . -B build-release-x64 -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DENTROPY_ENABLE_TESTS=OFF | |
| -DVCPKG_TARGET_TRIPLET=x64-osx | |
| -DCMAKE_OSX_ARCHITECTURES=x86_64 | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build (Release, x64) | |
| run: cmake --build build-release-x64 | |
| - name: Install package (Release, x64) | |
| run: cmake --install build-release-x64 --prefix "${{ github.workspace }}/install-x64" | |
| # Build arm64 Release with tests | |
| - name: Configure CMake (Ninja, Release, arm64) | |
| run: > | |
| cmake -S . -B build-release-arm64 -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DENTROPY_ENABLE_TESTS=ON | |
| -DVCPKG_TARGET_TRIPLET=arm64-osx | |
| -DCMAKE_OSX_ARCHITECTURES=arm64 | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build tests (Release, arm64) | |
| run: cmake --build build-release-arm64 --target EntropyCoreTests | |
| - name: Run tests (non-timer tests must pass) | |
| working-directory: build-release-arm64 | |
| run: ctest -VV --output-on-failure -E "TimerServiceTest" | |
| - name: Run timer tests (allowed to fail - timing-sensitive on CI) | |
| working-directory: build-release-arm64 | |
| run: ctest -VV --output-on-failure -R "TimerServiceTest" || true | |
| - name: Install package (Release, arm64) | |
| run: cmake --install build-release-arm64 --prefix "${{ github.workspace }}/install-arm64" | |
| # Build x64 Debug | |
| - name: Configure CMake (Ninja, Debug, x64) | |
| run: > | |
| cmake -S . -B build-debug-x64 -G Ninja | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DENTROPY_ENABLE_TESTS=OFF | |
| -DVCPKG_TARGET_TRIPLET=x64-osx | |
| -DCMAKE_OSX_ARCHITECTURES=x86_64 | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build (Debug, x64) | |
| run: cmake --build build-debug-x64 | |
| - name: Install package (Debug, x64) | |
| run: cmake --install build-debug-x64 --prefix "${{ github.workspace }}/install-x64-debug" | |
| # Build arm64 Debug | |
| - name: Configure CMake (Ninja, Debug, arm64) | |
| run: > | |
| cmake -S . -B build-debug-arm64 -G Ninja | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DENTROPY_ENABLE_TESTS=OFF | |
| -DVCPKG_TARGET_TRIPLET=arm64-osx | |
| -DCMAKE_OSX_ARCHITECTURES=arm64 | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build (Debug, arm64) | |
| run: cmake --build build-debug-arm64 | |
| - name: Install package (Debug, arm64) | |
| run: cmake --install build-debug-arm64 --prefix "${{ github.workspace }}/install-arm64-debug" | |
| # Create universal binaries with lipo | |
| - name: Create universal binaries | |
| run: | | |
| mkdir -p "${{ github.workspace }}/EntropyCore-macOS-universal/lib" | |
| mkdir -p "${{ github.workspace }}/EntropyCore-macOS-universal/debug/lib" | |
| # Combine Release libraries | |
| lipo -create \ | |
| "${{ github.workspace }}/install-x64/lib/libEntropyCore.a" \ | |
| "${{ github.workspace }}/install-arm64/lib/libEntropyCore.a" \ | |
| -output "${{ github.workspace }}/EntropyCore-macOS-universal/lib/libEntropyCore.a" | |
| # Combine Debug libraries | |
| lipo -create \ | |
| "${{ github.workspace }}/install-x64-debug/lib/libEntropyCore.a" \ | |
| "${{ github.workspace }}/install-arm64-debug/lib/libEntropyCore.a" \ | |
| -output "${{ github.workspace }}/EntropyCore-macOS-universal/debug/lib/libEntropyCore.a" | |
| # Copy headers and cmake files from arm64 build (they're identical) | |
| cp -r "${{ github.workspace }}/install-arm64/include" "${{ github.workspace }}/EntropyCore-macOS-universal/" | |
| cp -r "${{ github.workspace }}/install-arm64/lib/cmake" "${{ github.workspace }}/EntropyCore-macOS-universal/lib/" || true | |
| # Verify universal binaries | |
| echo "Release library architectures:" | |
| lipo -info "${{ github.workspace }}/EntropyCore-macOS-universal/lib/libEntropyCore.a" | |
| echo "Debug library architectures:" | |
| lipo -info "${{ github.workspace }}/EntropyCore-macOS-universal/debug/lib/libEntropyCore.a" | |
| - name: Upload CTest logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ctest-logs-macos | |
| path: | | |
| build-release-arm64/Testing/Temporary/LastTest.log | |
| build-release-arm64/Testing/**/Test.xml | |
| build-release-arm64/Testing/Temporary/LastTestsFailed.log | |
| - name: Upload macOS universal package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: EntropyCore-macOS-universal | |
| path: EntropyCore-macOS-universal/** | |
| sanitizer-asan-ubsan: | |
| name: Sanitizer Tests (ASAN + UBSAN, GCC 14) | |
| runs-on: ubuntu-24.04 | |
| continue-on-error: true # Don't fail CI, but report issues | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install prerequisites | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build gcc-14 g++-14 cmake | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 | |
| sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 100 | |
| sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 100 | |
| gcc --version | |
| g++ --version | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgGitCommitId: 'c59b04f668d20c7dd83f478835e8266a3cc51270' | |
| - name: Configure CMake with ASAN/UBSAN | |
| run: > | |
| cmake -S . -B build-asan -G Ninja | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DENTROPY_ENABLE_TESTS=ON | |
| -DENABLE_SANITIZERS=ON | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build tests with ASAN/UBSAN | |
| run: cmake --build build-asan --target EntropyCoreTests | |
| - name: Run tests with ASAN/UBSAN | |
| working-directory: build-asan | |
| run: ./EntropyCoreTests --gtest_brief=1 2>&1 | tee asan-ubsan-output.log | |
| continue-on-error: true # Capture failures but don't stop | |
| env: | |
| ASAN_OPTIONS: detect_leaks=1:check_initialization_order=1:detect_stack_use_after_return=1:strict_string_checks=1:detect_invalid_pointer_pairs=2:halt_on_error=1:abort_on_error=1 | |
| UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1:print_stacktrace=1 | |
| - name: Check for ASAN/UBSAN issues | |
| if: always() | |
| working-directory: build-asan | |
| run: | | |
| echo "## ASAN/UBSAN Results" >> $GITHUB_STEP_SUMMARY | |
| if grep -q "SUMMARY.*Sanitizer" asan-ubsan-output.log 2>/dev/null; then | |
| echo "⚠️ **Issues detected!**" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| grep -A 5 "SUMMARY.*Sanitizer" asan-ubsan-output.log | head -20 >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "📋 See full logs in artifacts: \`sanitizer-asan-ubsan-results\`" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "✅ **No issues detected**" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload ASAN/UBSAN results | |
| if: always() # Always upload, even on success | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sanitizer-asan-ubsan-results | |
| path: | | |
| build-asan/asan-ubsan-output.log | |
| build-asan/**/*.log | |
| sanitizer-tsan: | |
| name: Sanitizer Tests (TSAN, GCC 14) | |
| runs-on: ubuntu-24.04 | |
| continue-on-error: true # Don't fail CI, but report issues | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install prerequisites | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build gcc-14 g++-14 cmake | |
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 | |
| sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 | |
| sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 100 | |
| sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 100 | |
| gcc --version | |
| g++ --version | |
| - name: Setup vcpkg | |
| uses: lukka/run-vcpkg@v11 | |
| with: | |
| vcpkgGitCommitId: 'c59b04f668d20c7dd83f478835e8266a3cc51270' | |
| - name: Configure CMake with TSAN | |
| run: > | |
| cmake -S . -B build-tsan -G Ninja | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DENTROPY_ENABLE_TESTS=ON | |
| -DENABLE_SANITIZERS=ON | |
| -DENABLE_TSAN=ON | |
| -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake | |
| - name: Build tests with TSAN | |
| run: cmake --build build-tsan --target EntropyCoreTests | |
| - name: Run tests with TSAN | |
| working-directory: build-tsan | |
| run: ./EntropyCoreTests --gtest_brief=1 2>&1 | tee tsan-output.log | |
| continue-on-error: true # Capture failures but don't stop | |
| env: | |
| TSAN_OPTIONS: detect_deadlocks=1:second_deadlock_stack=1:history_size=7:io_sync=1:halt_on_error=1:abort_on_error=1 | |
| - name: Check for TSAN issues | |
| if: always() | |
| working-directory: build-tsan | |
| run: | | |
| echo "## TSAN Results" >> $GITHUB_STEP_SUMMARY | |
| if grep -q "WARNING.*ThreadSanitizer" tsan-output.log 2>/dev/null; then | |
| echo "⚠️ **Issues detected!**" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| grep -E "(WARNING.*ThreadSanitizer|SUMMARY.*ThreadSanitizer)" tsan-output.log | head -20 >> $GITHUB_STEP_SUMMARY | |
| echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "📋 See full logs in artifacts: \`sanitizer-tsan-results\`" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "✅ **No issues detected**" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload TSAN results | |
| if: always() # Always upload, even on success | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sanitizer-tsan-results | |
| path: | | |
| build-tsan/tsan-output.log | |
| build-tsan/**/*.log |