From 57e0959253145cf4c52655b0b755ab3260ec970a Mon Sep 17 00:00:00 2001 From: Duta-Sebastian Date: Mon, 11 Nov 2024 22:04:11 +0200 Subject: [PATCH] Testing merging rules --- .github/workflows/cmake.yml | 296 ++++++++++++++++++------------------ tests/HashingTest.cpp | 2 +- 2 files changed, 149 insertions(+), 149 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 7f621ef..0ff5dd7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -77,162 +77,162 @@ jobs: uses: ./.github/actions/clang-tidy - build: - name: ${{ matrix.name }} - # concurrency: - # group: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - permissions: - attestations: write - contents: write - id-token: write - - env: - CC: ${{ matrix.c }} - CXX: ${{ matrix.cxx }} - VSCMD_SKIP_SENDTELEMETRY: 1 - - # NOTE: replace with another version if this one does not work - # For more versions, see https://winlibs.com or - # https://github.com/brechtsanders/winlibs_mingw/releases/ - MINGW_VER: "13.3.0posix-11.0.1-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-13.3.0-mingw-w64msvcrt-11.0.1-r1.7z" - # Example: - # MINGW_VER: "13.3.0posix-11.0.1-ucrt-r1/winlibs-x86_64-posix-seh-gcc-13.3.0-mingw-w64ucrt-11.0.1-r1.7z" - # MINGW_VER: "14.1.0posix-18.1.7-12.0.0-ucrt-r2/winlibs-x86_64-posix-seh-gcc-14.1.0-mingw-w64ucrt-12.0.0-r2.7z" - # MINGW_VER: "14.1.0posix-18.1.7-12.0.0-msvcrt-r2/winlibs-x86_64-posix-seh-gcc-14.1.0-mingw-w64msvcrt-12.0.0-r2.7z" - - - strategy: - fail-fast: false - matrix: - include: +# build: +# name: ${{ matrix.name }} +# # concurrency: +# # group: ${{ matrix.name }} +# runs-on: ${{ matrix.os }} +# timeout-minutes: 15 +# permissions: +# attestations: write +# contents: write +# id-token: write +# +# env: +# CC: ${{ matrix.c }} +# CXX: ${{ matrix.cxx }} +# VSCMD_SKIP_SENDTELEMETRY: 1 +# +# # NOTE: replace with another version if this one does not work +# # For more versions, see https://winlibs.com or +# # https://github.com/brechtsanders/winlibs_mingw/releases/ +# MINGW_VER: "13.3.0posix-11.0.1-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-13.3.0-mingw-w64msvcrt-11.0.1-r1.7z" +# # Example: +# # MINGW_VER: "13.3.0posix-11.0.1-ucrt-r1/winlibs-x86_64-posix-seh-gcc-13.3.0-mingw-w64ucrt-11.0.1-r1.7z" +# # MINGW_VER: "14.1.0posix-18.1.7-12.0.0-ucrt-r2/winlibs-x86_64-posix-seh-gcc-14.1.0-mingw-w64ucrt-12.0.0-r2.7z" +# # MINGW_VER: "14.1.0posix-18.1.7-12.0.0-msvcrt-r2/winlibs-x86_64-posix-seh-gcc-14.1.0-mingw-w64msvcrt-12.0.0-r2.7z" +# +# +# strategy: +# fail-fast: false +# matrix: +# include: +## - os: ubuntu-22.04 +## c: clang-18 +## cxx: clang++-18 +## clang_ver: "18" +## clang_ver_full: "18.1.8" +## name: "MSan: Ubuntu 22.04 Clang 18" +## cmake_flags: "-DUSE_MSAN=ON" +## cmake_generator: Ninja +## # This env runs memory sanitizers +## runs_msan: true +# # - os: ubuntu-22.04 -# c: clang-18 -# cxx: clang++-18 -# clang_ver: "18" -# clang_ver_full: "18.1.8" -# name: "MSan: Ubuntu 22.04 Clang 18" -# cmake_flags: "-DUSE_MSAN=ON" -# cmake_generator: Ninja -# # This env runs memory sanitizers -# runs_msan: true - - - os: ubuntu-22.04 - c: gcc-12 - cxx: g++-12 - name: "ASan: Ubuntu 22.04 GCC 12" - cmake_flags: "-DUSE_ASAN=ON" - cmake_generator: Ninja - # This env runs address sanitizers - runs_asan: true - # this is used to add a suffix to the archive name since we use the same compiler version - asan_name: "-asan" - - - os: ubuntu-22.04 - c: gcc-12 - cxx: g++-12 - name: "Valgrind: Ubuntu 22.04 GCC 12" - # cmake_flags: - cmake_generator: Ninja - # This env runs valgrind - runs_valgrind: true - - - os: macos-14 - c: clang - cxx: clang++ - name: "macOS 14 Apple Clang 15" - cmake_flags: "-DUSE_ASAN=OFF" - # cmake_generator: - # This env runs address sanitizers - runs_asan: false - - - os: macos-14 - c: gcc-13 - cxx: g++-13 - name: "macOS 14 GCC 13" - # cmake_flags: - # cmake_generator: Ninja - -# - os: windows-2022 -# c: cl -# cxx: cl -# name: "ASan: Windows 2022 MSVC 19.41" +# c: gcc-12 +# cxx: g++-12 +# name: "ASan: Ubuntu 22.04 GCC 12" # cmake_flags: "-DUSE_ASAN=ON" -# # Ninja is not faster on MSVC because... MSVC -# # cmake_generator: "Ninja" -# # cmake_generator: "Ninja Multi-Config" +# cmake_generator: Ninja # # This env runs address sanitizers # runs_asan: true - - - os: windows-2022 - c: gcc - cxx: g++ - name: "Windows 2022 MinGW GCC 13" - # cmake_flags: - cmake_generator: Ninja - - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Install PostgreSQL - uses: ./.github/actions/install-postgres - - - name: Set timestamp and zip name - run: | - echo "TIMESTAMP=$(date +%Y-%m-%d-%H-%M-%S)" >> ${GITHUB_ENV} - - # use the full name as prefix: {user_name}_{repo_name} (replace / with _) - echo "ZIP_NAME=$(echo "${GITHUB_REPOSITORY}_${{ env.BUILD_TYPE }}_${{ matrix.os }}_${{ matrix.cxx }}${{ matrix.asan_name }}" | sed 's|/|_|')" >> ${GITHUB_ENV} - - # or use only the repo name (github does not have a predefined environment variable for this) - # the regex splits by / and keeps everything after / without the / character - # echo "ZIP_NAME=$(echo "${GITHUB_REPOSITORY}_${{ env.BUILD_TYPE }}_${{ matrix.os }}_${{ matrix.cxx }}${{ matrix.asan_name }}" | sed -E 's|.+/(.+)|\1|')" >> ${GITHUB_ENV} - - - name: Install packages - uses: ./.github/actions/install-packages - - - name: Configure CMake - uses: ./.github/actions/configure-cmake - with: - custom_flags: ${{ matrix.cmake_flags }} - warnings_as_errors: 'ON' - - name: Build - run: | - bash ./scripts/cmake.sh build -t ${{ env.BUILD_TYPE }} - - - name: Install - # Use CMake to "install" build artifacts (only interested in CMake registered targets) to our custom artifacts directory - run: | - bash ./scripts/cmake.sh install -i artifacts -t ${{ env.BUILD_TYPE }} - - - name: Move artifacts - run: | - mkdir ${{ env.ZIP_NAME }} - mv artifacts/${{ env.BIN_DIR }}/* ${{ env.ZIP_NAME }} - ls -la ${{ env.ZIP_NAME }} - - - name: Process artifacts - uses: ./.github/actions/process-artifacts - - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ env.ZIP_NAME }}_${{ env.TIMESTAMP }} - path: ${{ env.ZIP_NAME }} - retention-days: 30 - - name: Runtime checks - uses: ./.github/actions/runtime-checks - - - name: Create release - uses: ./.github/actions/create-release - if: startsWith(github.ref, 'refs/tags/') +# # this is used to add a suffix to the archive name since we use the same compiler version +# asan_name: "-asan" +# +# - os: ubuntu-22.04 +# c: gcc-12 +# cxx: g++-12 +# name: "Valgrind: Ubuntu 22.04 GCC 12" +# # cmake_flags: +# cmake_generator: Ninja +# # This env runs valgrind +# runs_valgrind: true +# +# - os: macos-14 +# c: clang +# cxx: clang++ +# name: "macOS 14 Apple Clang 15" +# cmake_flags: "-DUSE_ASAN=OFF" +# # cmake_generator: +# # This env runs address sanitizers +# runs_asan: false +# +# - os: macos-14 +# c: gcc-13 +# cxx: g++-13 +# name: "macOS 14 GCC 13" +# # cmake_flags: +# # cmake_generator: Ninja +# +## - os: windows-2022 +## c: cl +## cxx: cl +## name: "ASan: Windows 2022 MSVC 19.41" +## cmake_flags: "-DUSE_ASAN=ON" +## # Ninja is not faster on MSVC because... MSVC +## # cmake_generator: "Ninja" +## # cmake_generator: "Ninja Multi-Config" +## # This env runs address sanitizers +## runs_asan: true +# +# - os: windows-2022 +# c: gcc +# cxx: g++ +# name: "Windows 2022 MinGW GCC 13" +# # cmake_flags: +# cmake_generator: Ninja +# +# steps: +# - name: Checkout repo +# uses: actions/checkout@v4 +# +# - name: Install PostgreSQL +# uses: ./.github/actions/install-postgres +# +# - name: Set timestamp and zip name +# run: | +# echo "TIMESTAMP=$(date +%Y-%m-%d-%H-%M-%S)" >> ${GITHUB_ENV} +# +# # use the full name as prefix: {user_name}_{repo_name} (replace / with _) +# echo "ZIP_NAME=$(echo "${GITHUB_REPOSITORY}_${{ env.BUILD_TYPE }}_${{ matrix.os }}_${{ matrix.cxx }}${{ matrix.asan_name }}" | sed 's|/|_|')" >> ${GITHUB_ENV} +# +# # or use only the repo name (github does not have a predefined environment variable for this) +# # the regex splits by / and keeps everything after / without the / character +# # echo "ZIP_NAME=$(echo "${GITHUB_REPOSITORY}_${{ env.BUILD_TYPE }}_${{ matrix.os }}_${{ matrix.cxx }}${{ matrix.asan_name }}" | sed -E 's|.+/(.+)|\1|')" >> ${GITHUB_ENV} +# +# - name: Install packages +# uses: ./.github/actions/install-packages +# +# - name: Configure CMake +# uses: ./.github/actions/configure-cmake +# with: +# custom_flags: ${{ matrix.cmake_flags }} +# warnings_as_errors: 'ON' +# - name: Build +# run: | +# bash ./scripts/cmake.sh build -t ${{ env.BUILD_TYPE }} +# +# - name: Install +# # Use CMake to "install" build artifacts (only interested in CMake registered targets) to our custom artifacts directory +# run: | +# bash ./scripts/cmake.sh install -i artifacts -t ${{ env.BUILD_TYPE }} +# +# - name: Move artifacts +# run: | +# mkdir ${{ env.ZIP_NAME }} +# mv artifacts/${{ env.BIN_DIR }}/* ${{ env.ZIP_NAME }} +# ls -la ${{ env.ZIP_NAME }} +# +# - name: Process artifacts +# uses: ./.github/actions/process-artifacts +# +# - name: Upload Artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ env.ZIP_NAME }}_${{ env.TIMESTAMP }} +# path: ${{ env.ZIP_NAME }} +# retention-days: 30 +# - name: Runtime checks +# uses: ./.github/actions/runtime-checks +# +# - name: Create release +# uses: ./.github/actions/create-release +# if: startsWith(github.ref, 'refs/tags/') test: name: "Test" runs-on: ubuntu-latest - needs: build + #needs: build timeout-minutes: 5 services: postgres: diff --git a/tests/HashingTest.cpp b/tests/HashingTest.cpp index a38aa34..98c46cb 100644 --- a/tests/HashingTest.cpp +++ b/tests/HashingTest.cpp @@ -8,7 +8,7 @@ TEST(HashingTest, HashFunctionReturnsExpectedValue) { const auto password = "password"; const auto actualHashedPassword = digestpp::sha512().absorb(password).hexdigest(); const auto expectedHashedPassword = "b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86"; - ASSERT_EQ(expectedHashedPassword, actualHashedPassword); + ASSERT_NE(expectedHashedPassword, actualHashedPassword); } TEST(HashingTest, SaltGeneratorIsUnique) {