Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Sep 4, 2024
1 parent 8242b5e commit d145978
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 20 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/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"
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-gcc
env:
NIX_CONFIG: |
cores = 6
26 changes: 26 additions & 0 deletions .github/workflows/mac-nix-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Crypto3 Build and Test on macOS Platforms

on:
workflow_call:

jobs:
build-and-test:
name: "Build and test macOS"
runs-on: [macos-14]
steps:
- name: Checkout Crypto3
uses: actions/checkout@v4
with:
fetch-depth: 0

# From https://github.com/DeterminateSystems/magic-nix-cache-action
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main

- name: Run checks
run: nix flake -L check
env:
NIX_CONFIG: |
cores = 0
max-jobs = 1
30 changes: 30 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PR Testing

on:
pull_request:
push:
branches:
- master

concurrency:
# In master we want to run for every commit, in other branches — only for the last one
group: ${{
( github.ref == 'refs/heads/master' && format('{0}/{1}/{2}', github.workflow, github.ref, github.sha) )
||
format('{0}/{1}', github.workflow, github.ref) }}
cancel-in-progress: true

jobs:
test-linux:
name: Linux Crypto3 Testing
uses: ./.github/workflows/linux-nix-check.yml
if: |
always() && !cancelled()
secrets: inherit

test-mac:
name: macOS Crypto3 Testing
uses: ./.github/workflows/mac-nix-check.yml
if: |
always() && !cancelled()
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <iostream>
#include <fstream>
#include <cstdint>

#include <boost/test/unit_test.hpp>

Expand Down
13 changes: 7 additions & 6 deletions crypto3/libs/containers/test/merkle/merkle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@

#define BOOST_TEST_MODULE containter_merkletree_test

#include <chrono>
#include <cstdio>
#include <limits>
#include <type_traits>
#include <cstdint>

#include <nil/crypto3/algebra/random_element.hpp>
#include <nil/crypto3/algebra/type_traits.hpp>
#include <nil/crypto3/hash/block_to_field_elements_wrapper.hpp>
Expand All @@ -35,6 +41,7 @@
#include <nil/crypto3/hash/keccak.hpp>
#include <nil/crypto3/hash/pedersen.hpp>
#include <nil/crypto3/hash/poseidon.hpp>
#include <nil/crypto3/hash/algorithm/hash.hpp>

#include <nil/crypto3/container/merkle/tree.hpp>
#include <nil/crypto3/container/merkle/proof.hpp>
Expand All @@ -43,12 +50,6 @@
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>

#include <chrono>
#include <cstdio>
#include <limits>
#include <type_traits>
#include <nil/crypto3/hash/algorithm/hash.hpp>

using namespace nil::crypto3;
using namespace nil::crypto3::containers;

Expand Down
13 changes: 7 additions & 6 deletions crypto3/libs/hash/test/crc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

#define BOOST_TEST_MODULE crc_test

#include <iostream>
#include <string>
#include <cassert>
#include <cstdint>
#include <unordered_map>

#include <nil/crypto3/hash/algorithm/hash.hpp>

#include <nil/crypto3/hash/crc.hpp>
Expand All @@ -19,11 +25,6 @@
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>

#include <iostream>
#include <string>
#include <cassert>
#include <unordered_map>

using namespace nil::crypto3;
using namespace nil::crypto3::hashes;
using namespace nil::crypto3::accumulators;
Expand Down Expand Up @@ -130,4 +131,4 @@ BOOST_AUTO_TEST_CASE(crc_stateful_hash3) {
BOOST_CHECK_EQUAL(d, "a7943e77");
}

BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE_END()
14 changes: 7 additions & 7 deletions crypto3/libs/hash/test/tiger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

#define BOOST_TEST_MODULE tiger_test

#include <iostream>
#include <string>
#include <unordered_map>
#include <cstdio>
#include <cstdint>

#include <nil/crypto3/hash/algorithm/hash.hpp>
#include <nil/crypto3/hash/adaptor/hashed.hpp>

Expand All @@ -39,12 +45,6 @@

#include <boost/static_assert.hpp>

#include <iostream>
#include <string>
#include <unordered_map>

#include <cstdio>

using namespace nil::crypto3;
using namespace nil::crypto3::accumulators;

Expand Down Expand Up @@ -155,4 +155,4 @@ BOOST_AUTO_TEST_CASE(tiger_iterator_hash7) {
BOOST_CHECK_EQUAL("1c14795529fd9f207a958f84c52f11e887fa0cabdfd91bfd", out);
}

BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE_END()
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <boost/random/uniform_int.hpp>
#include <iostream>
#include <iomanip>
#include <cstdint>

#include <nil/marshalling/status_type.hpp>
#include <nil/marshalling/endianness.hpp>
Expand Down
1 change: 1 addition & 0 deletions crypto3/libs/random/test/rfc6979.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <cstdint>

#include <boost/test/unit_test.hpp>

Expand Down
4 changes: 3 additions & 1 deletion evm-assigner/lib/assigner/evmone/instructions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once

#include <iostream>
#include <algorithm>

#include "eof.hpp"
#include "execution_state.hpp"
#include "instructions_traits.hpp"
#include "instructions_xmacro.hpp"
#include <ethash/keccak.hpp>
#include <iostream>

namespace evmone
{
Expand Down
1 change: 1 addition & 0 deletions evm-assigner/lib/assigner/test/assigner_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <map>
#include <algorithm>

#include <assigner.hpp>
#include <nil/blueprint/blueprint/plonk/assignment.hpp>
Expand Down

0 comments on commit d145978

Please sign in to comment.