Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back nightly testing of blst dependency #410

Merged
merged 14 commits into from
Jun 22, 2023
80 changes: 80 additions & 0 deletions .github/workflows/build-blst-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and Test with blst Nightly

on:
schedule:
- cron: "0 11 * * *"
workflow_dispatch:

concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main') && github.sha || '' }}
cancel-in-progress: true

jobs:
build_with_blst_main:
name: Build and Test with blst Nightly
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Ubuntu build C++ and test blst at origin/main
if: startsWith(matrix.os, 'ubuntu')
# blst is still using master instead of main
env:
BLST_MAIN: 1
run: |
echo "blst origin/main commit:"
curl -H "application/vnd.github.v3.sha" \
https://api.github.com/repos/supranational/blst/commits/master | \
head -10
cmake -B build .
cmake --build build -- -j 6
echo "Running ./src/runtest"
./build/src/runtest

- name: Mac OS build C++ and test
if: startsWith(matrix.os, 'macos')
env:
BLST_MAIN: 1
MACOSX_DEPLOYMENT_TARGET: 10.14
run: |
cmake -B build .
cmake --build build -- -j 6
echo "Running ./src/runtest"
./build/src/runtest

- name: Windows build C++ and test
if: startsWith(matrix.os, 'windows')
env:
BLST_MAIN: 1
run: |
cmake -B build .
cmake --build build
echo "Running runtest"
build\src\Debug\runtest.exe

- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Test pure python implementation
run: |
python python-impl/impl-test.py

- name: Install emsdk
uses: mymindstorm/setup-emsdk@v11

- name: Test javascript bindings
env:
BLST_MAIN: 1
run: |
emcc -v
sh emsdk_build.sh
sh js_test.sh
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ set(SODIUM_DISABLE_TESTS "on" CACHE STRING "")
set(SODIUM_CHIA_MINIMAL "on" CACHE STRING "")
FetchContent_MakeAvailable(Sodium)

set(BLST_GIT_TAG "a8cd361c9f671577aeab3f074098443af92a53fc")
set(BLST_REPOSITORY "https://github.com/supranational/blst")
if (DEFINED ENV{BLST_MAIN})
set(BLST_GIT_TAG "origin/master")
else ()
# This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5
set(BLST_GIT_TAG "a8cd361c9f671577aeab3f074098443af92a53fc")
endif ()
set(BLST_REPOSITORY "https://github.com/supranational/blst.git")

message(STATUS "blst will be built from: ${BLST_GIT_TAG} and repository ${BLST_REPOSITORY}")

Expand Down
4 changes: 4 additions & 0 deletions python-bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ FetchContent_MakeAvailable(pybind11)

pybind11_add_module(blspy ${CMAKE_CURRENT_SOURCE_DIR}/pythonbindings.cpp)
target_link_libraries(blspy PRIVATE bls)

if((NOT MSVC) AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin"))
target_link_options(blspy PRIVATE -Wl,-Bsymbolic)
endif()