Skip to content

Commit

Permalink
Merge pull request #52 from NilFoundation/48-add-non-native-eddsa-com…
Browse files Browse the repository at this point in the history
…ponent

48 add non native eddsa component
  • Loading branch information
Luannet authored Aug 19, 2022
2 parents fcef518 + 110e926 commit 43d2b32
Show file tree
Hide file tree
Showing 42 changed files with 2,620 additions and 539 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Run tests

on:
# Triggers the workflow on pull request events but only for the master branch
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
SUITE_REPO: "NilFoundation/crypto3"
LIB_NAME: "blueprint"
CACHE_NAME: "checkout-job-cache"

jobs:
checkout:
runs-on: [self-hosted, tests-runner]
steps:
- name: Cleanup # TODO - move to scripts on runner
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- name: Checkout suite
uses: actions/checkout@v3
with:
repository: ${{ env.SUITE_REPO }}
submodules: recursive

- name: Checkout source code
uses: actions/checkout@v3
with:
path: ./libs/${{ env.LIB_NAME }}
submodules: recursive

- name: Cmake and build
env:
CMAKE_ARGS: "
-DCMAKE_BUILD_TYPE=Debug
-DBUILD_SHARED_LIBS=FALSE
-DBUILD_TESTS=TRUE
"
run: |
mkdir build
cd build
cmake ${{ env.CMAKE_ARGS }} ..
- name: Archive build results
run: |
touch ${{ env.CACHE_NAME }}.tar.gz
tar -czf ${{ env.CACHE_NAME }}.tar.gz --exclude=${{ env.CACHE_NAME }}.tar.gz .
- name: Cache archived job output
uses: actions/upload-artifact@v3
with:
name: ${{ env.CACHE_NAME }}
path: ${{ env.CACHE_NAME }}.tar.gz
retention-days: 1


run_tests:
runs-on: [self-hosted]
needs: [checkout]
strategy:
fail-fast: false
matrix:
target: [
blueprint_hashes_plonk_sha256_process_test,
blueprint_hashes_plonk_sha512_process_test,
blueprint_non_native_plonk_non_native_demo_test,
blueprint_non_native_plonk_non_native_range_test,
blueprint_non_native_plonk_fixed_base_mul_test,
blueprint_non_native_plonk_complete_addition_test,
blueprint_non_native_plonk_var_base_mul_per_bit_test,
blueprint_non_native_plonk_variable_base_multiplication_test,
] # Tests to execute
steps:
- name: Cleanup # TODO - move to scripts on runner
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- name: Upload checkout job cache
uses: actions/download-artifact@v3
with:
name: ${{ env.CACHE_NAME }}

- name: Extract artifacts
run: |
tar -xf ${{ env.CACHE_NAME }}.tar.gz
rm ${{ env.CACHE_NAME }}.tar.gz
- name: Build
working-directory: ./build
run: cmake --build . -t ${{ matrix.target }}

- name: Run test
working-directory: ./build
run: |
cd libs/${{ env.LIB_NAME }}/test
COLOR='\033[0;33m'
echo -e "${COLOR}${{ matrix.target }}"
./${{ matrix.target }}
30 changes: 30 additions & 0 deletions .github/workflows/set_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Set version

on:
# Triggers the workflow on push to master branch
push:
branches: [ master ]

jobs:
set_version:
name: Set and tag version
runs-on: [ubuntu-latest]
env:
VERSION_FILE_NAME: VERSION
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set version
id: set_version
run: |
version=$(cat ${{ env.VERSION_FILE_NAME }} | tr -d '\r').$GITHUB_RUN_NUMBER
echo "VERSION=$version" >> $GITHUB_ENV
- name: Tag new version
run: git tag v${{ env.VERSION }}

- name: Push tags
uses: ad-m/github-push-action@master
with:
tags: true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Circuit definition library for =nil; Foundation's cryptography suite.

[![Run tests](https://github.com/NilFoundation/crypto3-blueprint/actions/workflows/run_tests.yml/badge.svg)](https://github.com/NilFoundation/crypto3-blueprint/actions/workflows/run_tests.yml)

## Building

This library uses Boost CMake build modules (https://github.com/BoostCMake/cmake_modules.git).
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0
6 changes: 6 additions & 0 deletions cmake/TargetArchitecture.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ function(target_architecture OUTPUT_ARCHITECTURE)
set(osx_arch_i386 TRUE)
elseif("${osx_arch}" STREQUAL "x86_64")
set(osx_arch_x86_64 TRUE)
elseif("${osx_arch}" STREQUAL "arm64")
set(osx_arch_arm64 TRUE)
elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
set(osx_arch_ppc64 TRUE)
else()
Expand All @@ -124,6 +126,10 @@ function(target_architecture OUTPUT_ARCHITECTURE)
if(osx_arch_ppc64)
list(APPEND ARCH ppc64)
endif()

if(osx_arch_arm64)
list(APPEND ARCH arm64)
endif()
else()
file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}")

Expand Down
Loading

0 comments on commit 43d2b32

Please sign in to comment.