Fixes a few memory leaks in debug code Fix for big-endian support Sync test vectors for prof testing
115 lines
4.3 KiB
YAML
115 lines
4.3 KiB
YAML
name: CMake
|
|
|
|
on:
|
|
push:
|
|
branches: [ '*' ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
env:
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
BUILD_TYPE: Release
|
|
|
|
jobs:
|
|
build:
|
|
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
|
# You can convert this to a matrix build if you need cross-platform coverage.
|
|
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
sqisign_build_type: [ref]
|
|
sqisign_test_reps: [10]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install dependencies Valgrind, GMP, Doxygen, TeX
|
|
run: |
|
|
sudo apt update && sudo apt --fix-missing install valgrind libgmp-dev doxygen texlive-xetex
|
|
echo "Valgrind installed"
|
|
|
|
- name: Configure CMake
|
|
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
|
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
|
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DSQISIGN_TEST_REPS=${{ matrix.sqisign_test_reps }}
|
|
|
|
- name: Build
|
|
# Build your program with the given configuration
|
|
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
|
|
|
- name: Build documentation
|
|
# Create html and latex documentation, TODO: do we need different docs for ref and opt?
|
|
run: doxygen Doxyfile && cd latex && xelatex refman
|
|
|
|
- name: Upload latex documentation
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: docs
|
|
path: latex/refman.pdf
|
|
|
|
- name: Test
|
|
working-directory: ${{github.workspace}}/build
|
|
# Execute tests defined by the CMake configuration.
|
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
|
run: ctest -j4 -C ${{env.BUILD_TYPE}}
|
|
|
|
- name: Examples
|
|
working-directory: ${{github.workspace}}/build/apps
|
|
run: |
|
|
./example_nistapi_lvl1
|
|
./example_nistapi_lvl3
|
|
./example_nistapi_lvl5
|
|
|
|
- name: CT-Tests
|
|
# TODO: re-enable for those tests that should be ct
|
|
if: false
|
|
run: |
|
|
rm -rf build
|
|
cmake -Bbuild -DENABLE_CT_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DSQISIGN_TEST_REPS=${{ matrix.sqisign_test_reps }}
|
|
cmake --build build
|
|
# valgrind --track-origins=yes build/
|
|
# valgrind --track-origins=yes build/
|
|
# valgrind --track-origins=yes build/
|
|
# valgrind --track-origins=yes build/
|
|
|
|
- name: Memcheck
|
|
run: |
|
|
rm -rf build
|
|
cmake -Bbuild -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DSQISIGN_TEST_REPS=${{ matrix.sqisign_test_reps }}
|
|
cmake --build build
|
|
ctest -T memcheck --test-dir build
|
|
if: false
|
|
|
|
- name: Address Sanitizer ASAN
|
|
run: |
|
|
rm -rf build
|
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=ASAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang -DSQISIGN_TEST_REPS=1
|
|
cmake --build build
|
|
ctest -j4 -v --test-dir build
|
|
|
|
# MSAN needs instrumented gmp
|
|
- name: Memory Sanitizer MSAN
|
|
run: |
|
|
rm -rf build
|
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=MSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang -DSQISIGN_TEST_REPS=1
|
|
cmake --build build
|
|
ctest -j4 -v --test-dir build
|
|
|
|
if: false
|
|
|
|
- name: Leak Sanitizer LSAN
|
|
run: |
|
|
rm -rf build
|
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=LSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang -DSQISIGN_TEST_REPS=1
|
|
cmake --build build
|
|
ctest -j4 -v --test-dir build
|
|
|
|
- name: Undefined Behavior Sanitizer UBSAN
|
|
run: |
|
|
rm -rf build
|
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=UBSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang -DSQISIGN_TEST_REPS=1
|
|
cmake --build build
|
|
ctest -j4 -v --test-dir build
|