Skip to content

Commit

Permalink
create two jobs - for gcc and clang
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Sep 5, 2024
1 parent d1b7165 commit b0da678
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 9 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/clang-linux-nix-check.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions crypto3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions crypto3/crypto3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
];

Expand Down
2 changes: 0 additions & 2 deletions evm-assigner/evm-assigner.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
];

Expand Down
4 changes: 4 additions & 0 deletions evm-assigner/lib/assigner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0da678

Please sign in to comment.