diff --git a/.github/workflows/clang-linux-nix-check.yml b/.github/workflows/clang-linux-nix-check.yml new file mode 100644 index 0000000000..43f37fa63f --- /dev/null +++ b/.github/workflows/clang-linux-nix-check.yml @@ -0,0 +1,24 @@ +name: Build and Test on Linux Platforms + +on: + workflow_call: + +jobs: + build-and-test: + name: "Build and test Linux with clang" + runs-on: [self-hosted, Linux, X64, aws_autoscaling] + steps: + # https://github.com/actions/checkout/issues/1552 + - name: Clean up after previous checkout + run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*; + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Run checks + run: nix build -L .?#checks.x86_64-linux.all-clang + env: + NIX_CONFIG: | + cores = 4 diff --git a/.github/workflows/linux-nix-check.yml b/.github/workflows/gcc-linux-nix-check.yml similarity index 93% rename from .github/workflows/linux-nix-check.yml rename to .github/workflows/gcc-linux-nix-check.yml index 87eb515db4..43af748ee2 100644 --- a/.github/workflows/linux-nix-check.yml +++ b/.github/workflows/gcc-linux-nix-check.yml @@ -5,7 +5,7 @@ on: jobs: build-and-test: - name: "Build and test Linux" + name: "Build and test Linux with gcc" runs-on: [self-hosted, Linux, X64, aws_autoscaling] steps: # https://github.com/actions/checkout/issues/1552 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ed2496a0c8..7f2f09e15c 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,9 +15,16 @@ concurrency: cancel-in-progress: true jobs: - test-linux: - name: Linux Crypto3 Testing - uses: ./.github/workflows/linux-nix-check.yml + test-linux-gcc: + name: Linux Crypto3 Testing with gcc + uses: ./.github/workflows/gcc-linux-nix-check.yml + if: | + always() && !cancelled() + secrets: inherit + + test-linux-clang: + name: Linux Crypto3 Testing with clang + uses: ./.github/workflows/clang-linux-nix-check.yml if: | always() && !cancelled() secrets: inherit diff --git a/crypto3/CMakeLists.txt b/crypto3/CMakeLists.txt index 849f8b7c26..927c94dd7e 100644 --- a/crypto3/CMakeLists.txt +++ b/crypto3/CMakeLists.txt @@ -22,6 +22,10 @@ option(CMAKE_ENABLE_TESTS "Enable tests" FALSE) # used by CMTest module option(BUILD_BENCH_TESTS "Build performance benchmark tests" FALSE) option(BUILD_DOCS "Build with configuring Doxygen documentation compiler" FALSE) +if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(CMAKE_CXX_FLAGS "-ggdb -O0") +endif() + # This is useful due to some build systems (Ninja in particular) are piping # compiler output and compiler switches it's output to plain text option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE) diff --git a/crypto3/crypto3.nix b/crypto3/crypto3.nix index c6a05331fc..dd992e7c72 100644 --- a/crypto3/crypto3.nix +++ b/crypto3/crypto3.nix @@ -27,10 +27,7 @@ in stdenv.mkDerivation { cmakeFlags = [ (if runTests then "-DBUILD_TESTS=TRUE" else "") - (if runTests then "-DCMAKE_ENABLE_TESTS=TRUE" else "") (if enableDebug then "-DCMAKE_BUILD_TYPE=Debug" else "-DCMAKE_BUILD_TYPE=Release") - (if enableDebug then "-DCMAKE_CXX_FLAGS=-ggdb" else "") - (if enableDebug then "-DCMAKE_CXX_FLAGS=-O0" else "") "-G Ninja" ]; diff --git a/evm-assigner/evm-assigner.nix b/evm-assigner/evm-assigner.nix index 9405a38005..cc65a3c3ab 100644 --- a/evm-assigner/evm-assigner.nix +++ b/evm-assigner/evm-assigner.nix @@ -32,10 +32,8 @@ in stdenv.mkDerivation rec { cmakeFlags = [ (if runTests then "-DBUILD_TESTS=TRUE" else "") - (if runTests then "-DCMAKE_ENABLE_TESTS=TRUE" else "") (if runTests then "-DBUILD_ASSIGNER_TESTS=TRUE" else "") (if enableDebug then "-DCMAKE_BUILD_TYPE=Debug" else "-DCMAKE_BUILD_TYPE=Release") - (if enableDebug then "-DCMAKE_CXX_FLAGS=-ggdb" else "") "-G Ninja" ]; diff --git a/evm-assigner/lib/assigner/CMakeLists.txt b/evm-assigner/lib/assigner/CMakeLists.txt index c824cb9a2f..9618e328e7 100644 --- a/evm-assigner/lib/assigner/CMakeLists.txt +++ b/evm-assigner/lib/assigner/CMakeLists.txt @@ -5,6 +5,10 @@ cmake_policy(SET CMP0063 NEW) option(BUILD_ASSIGNER_TESTS "Build unit tests" FALSE) +if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") + set(CMAKE_CXX_FLAGS "-ggdb -O0") +endif() + set(evmone_sources ${CMAKE_CURRENT_SOURCE_DIR}/evmone/baseline.cpp ${CMAKE_CURRENT_SOURCE_DIR}/evmone/baseline_instruction_table.cpp