diff --git a/.github/workflows/linux-nix-check.yml b/.github/workflows/linux-nix-check.yml new file mode 100644 index 0000000000..1a28a83894 --- /dev/null +++ b/.github/workflows/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" + 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 diff --git a/.github/workflows/mac-nix-check.yml b/.github/workflows/mac-nix-check.yml new file mode 100644 index 0000000000..99fb449563 --- /dev/null +++ b/.github/workflows/mac-nix-check.yml @@ -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 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000000..950321c399 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -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 diff --git a/crypto3/libs/blueprint/test/verifiers/placeholder/verifier.cpp b/crypto3/libs/blueprint/test/verifiers/placeholder/verifier.cpp index 9e2f757347..535e95cc23 100644 --- a/crypto3/libs/blueprint/test/verifiers/placeholder/verifier.cpp +++ b/crypto3/libs/blueprint/test/verifiers/placeholder/verifier.cpp @@ -25,6 +25,7 @@ #include #include +#include #include diff --git a/crypto3/libs/containers/test/merkle/merkle.cpp b/crypto3/libs/containers/test/merkle/merkle.cpp index f3d8dc2d5d..7db3a093f4 100644 --- a/crypto3/libs/containers/test/merkle/merkle.cpp +++ b/crypto3/libs/containers/test/merkle/merkle.cpp @@ -26,6 +26,12 @@ #define BOOST_TEST_MODULE containter_merkletree_test +#include +#include +#include +#include +#include + #include #include #include @@ -35,6 +41,7 @@ #include #include #include +#include #include #include @@ -43,12 +50,6 @@ #include #include -#include -#include -#include -#include -#include - using namespace nil::crypto3; using namespace nil::crypto3::containers; diff --git a/crypto3/libs/hash/test/crc.cpp b/crypto3/libs/hash/test/crc.cpp index 8258c917a5..ea06f683f1 100644 --- a/crypto3/libs/hash/test/crc.cpp +++ b/crypto3/libs/hash/test/crc.cpp @@ -8,6 +8,12 @@ #define BOOST_TEST_MODULE crc_test +#include +#include +#include +#include +#include + #include #include @@ -19,11 +25,6 @@ #include #include -#include -#include -#include -#include - using namespace nil::crypto3; using namespace nil::crypto3::hashes; using namespace nil::crypto3::accumulators; @@ -130,4 +131,4 @@ BOOST_AUTO_TEST_CASE(crc_stateful_hash3) { BOOST_CHECK_EQUAL(d, "a7943e77"); } -BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file +BOOST_AUTO_TEST_SUITE_END() diff --git a/crypto3/libs/hash/test/tiger.cpp b/crypto3/libs/hash/test/tiger.cpp index 54c5dad6c6..cbc1a69469 100644 --- a/crypto3/libs/hash/test/tiger.cpp +++ b/crypto3/libs/hash/test/tiger.cpp @@ -25,6 +25,12 @@ #define BOOST_TEST_MODULE tiger_test +#include +#include +#include +#include +#include + #include #include @@ -39,12 +45,6 @@ #include -#include -#include -#include - -#include - using namespace nil::crypto3; using namespace nil::crypto3::accumulators; @@ -155,4 +155,4 @@ BOOST_AUTO_TEST_CASE(tiger_iterator_hash7) { BOOST_CHECK_EQUAL("1c14795529fd9f207a958f84c52f11e887fa0cabdfd91bfd", out); } -BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file +BOOST_AUTO_TEST_SUITE_END() diff --git a/crypto3/libs/marshalling/algebra/test/curve_element_fixed_size_container.cpp b/crypto3/libs/marshalling/algebra/test/curve_element_fixed_size_container.cpp index d94c0cf3f5..f08df42607 100644 --- a/crypto3/libs/marshalling/algebra/test/curve_element_fixed_size_container.cpp +++ b/crypto3/libs/marshalling/algebra/test/curve_element_fixed_size_container.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/crypto3/libs/random/test/rfc6979.cpp b/crypto3/libs/random/test/rfc6979.cpp index baf665545f..d69bdceca2 100644 --- a/crypto3/libs/random/test/rfc6979.cpp +++ b/crypto3/libs/random/test/rfc6979.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include diff --git a/evm-assigner/lib/assigner/evmone/instructions.hpp b/evm-assigner/lib/assigner/evmone/instructions.hpp index 8990cad666..bee02e7c64 100644 --- a/evm-assigner/lib/assigner/evmone/instructions.hpp +++ b/evm-assigner/lib/assigner/evmone/instructions.hpp @@ -3,12 +3,14 @@ // SPDX-License-Identifier: Apache-2.0 #pragma once +#include +#include + #include "eof.hpp" #include "execution_state.hpp" #include "instructions_traits.hpp" #include "instructions_xmacro.hpp" #include -#include namespace evmone { diff --git a/evm-assigner/lib/assigner/test/assigner_test.cpp b/evm-assigner/lib/assigner/test/assigner_test.cpp index 6d9d60a703..2f0bc39ec0 100644 --- a/evm-assigner/lib/assigner/test/assigner_test.cpp +++ b/evm-assigner/lib/assigner/test/assigner_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include