Run clang sanitizers in CI + workflow cleanup (#196)
* Run clang sanitizers in CI + workflow cleanup * Update makefile * Update workflow names * Simplify more * Run go benchmarks in CI * Fix indentation nits * Initialize variable in fr_is_one * Revert "Initialize variable in fr_is_one" This reverts commit f4c2749e410c68479f83d78c9a1780efe191c7fe. * Move .PHONY outside of condition
This commit is contained in:
parent
9b91f3b832
commit
4f0546af81
|
@ -1,4 +1,4 @@
|
|||
name: CKZG tests
|
||||
name: C
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
@ -8,12 +8,17 @@ on:
|
|||
- main
|
||||
|
||||
jobs:
|
||||
test-ckzg:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Check formatting
|
||||
run: |
|
||||
cd src
|
||||
make format
|
||||
git diff --exit-code
|
||||
- name: Build
|
||||
run: |
|
||||
cd src
|
||||
|
@ -23,6 +28,10 @@ jobs:
|
|||
run: |
|
||||
cd src
|
||||
make test
|
||||
- name: Clang Sanitizers
|
||||
run: |
|
||||
cd src
|
||||
make sanitize
|
||||
- name: Clang Static Analyzer
|
||||
run: |
|
||||
cd src
|
|
@ -1,4 +1,4 @@
|
|||
name: C# bindings test and build
|
||||
name: C#
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
|
@ -1,21 +0,0 @@
|
|||
name: Formatting tests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Check formatting
|
||||
run: |
|
||||
cd src
|
||||
make format
|
||||
git diff --exit-code
|
|
@ -1,4 +1,4 @@
|
|||
name: Go bindings tests
|
||||
name: Go
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
@ -8,7 +8,7 @@ on:
|
|||
- main
|
||||
|
||||
jobs:
|
||||
test-go-bindings:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Go
|
||||
|
@ -22,7 +22,11 @@ jobs:
|
|||
- name: Test
|
||||
run: |
|
||||
cd bindings/go
|
||||
go test .
|
||||
go test
|
||||
- name: Benchmark
|
||||
run: |
|
||||
cd bindings/go
|
||||
go test -bench=Benchmark
|
||||
- name: Check headers
|
||||
run: |
|
||||
cmp blst/bindings/blst.h bindings/go/blst_headers/blst.h
|
|
@ -1,4 +1,4 @@
|
|||
name: Java bindings tests
|
||||
name: Java
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -9,7 +9,7 @@ on:
|
|||
- main
|
||||
|
||||
jobs:
|
||||
test-java-bindings:
|
||||
tests:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
@ -1,4 +1,4 @@
|
|||
name: Nim bindings tests
|
||||
name: Nim
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
@ -8,7 +8,7 @@ on:
|
|||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
tests:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
|
@ -1,4 +1,4 @@
|
|||
name: NodeJS bindings tests
|
||||
name: NodeJS
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
@ -8,7 +8,7 @@ on:
|
|||
- main
|
||||
|
||||
jobs:
|
||||
test-nodejs-bindings:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
|
@ -1,4 +1,4 @@
|
|||
name: Python bindings tests
|
||||
name: Python
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
@ -8,7 +8,7 @@ on:
|
|||
- main
|
||||
|
||||
jobs:
|
||||
test-python-bindings:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
|
@ -1,4 +1,4 @@
|
|||
name: Rust bindings tests
|
||||
name: Rust
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
@ -8,7 +8,7 @@ on:
|
|||
- main
|
||||
|
||||
jobs:
|
||||
test-rust-bindings:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
24
src/Makefile
24
src/Makefile
|
@ -95,6 +95,30 @@ profile: \
|
|||
profile_verify_blob_kzg_proof \
|
||||
profile_verify_blob_kzg_proof_batch
|
||||
|
||||
.PHONY: sanitize_%
|
||||
sanitize_%: test_c_kzg_4844.c c_kzg_4844.c
|
||||
@echo Running sanitize=$*...
|
||||
@$(CC) $(CFLAGS) $(NO_OPTIMIZE) -fsanitize=$* -o $@ $< $(BLST)
|
||||
@ASAN_OPTIONS=allocator_may_return_null=1 \
|
||||
LSAN_OPTIONS=allocator_may_return_null=1 \
|
||||
./$@; rm $@
|
||||
|
||||
ifneq ($(OS),Windows_NT)
|
||||
UNAME_S := $(shell uname -s)
|
||||
.PHONY: sanitize
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
sanitize: \
|
||||
sanitize_address \
|
||||
sanitize_undefined
|
||||
else
|
||||
sanitize: \
|
||||
sanitize_address \
|
||||
sanitize_leak \
|
||||
sanitize_safe-stack \
|
||||
sanitize_undefined
|
||||
endif
|
||||
endif
|
||||
|
||||
.PHONY: analyze
|
||||
analyze: c_kzg_4844.c
|
||||
@$(CC) --analyze -Xanalyzer -analyzer-output=html \
|
||||
|
|
|
@ -259,7 +259,7 @@ static void test_fr_pow__test_inverse_on_root_of_unity(void) {
|
|||
|
||||
blst_fr_from_uint64(&a, SCALE2_ROOT_OF_UNITY[31]);
|
||||
|
||||
fr_pow(&r, &a, 1 << 31);
|
||||
fr_pow(&r, &a, 1ULL << 31);
|
||||
|
||||
bool ok = fr_equal(&r, &FR_ONE);
|
||||
ASSERT_EQUALS(ok, true);
|
||||
|
|
Loading…
Reference in New Issue