Skip to content

Commit

Permalink
updated CI and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
floyd committed Mar 10, 2024
1 parent e219776 commit 27f4e2d
Show file tree
Hide file tree
Showing 10 changed files with 485 additions and 46 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: arm

on: [push]


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: pguyot/arm-runner-action@HEAD
with:
bind_mount_repository: true
base_image: raspios_lite_arm64:latest
cpu: cortex-a53
image_additional_mb: 512
commands: |
sudo apt-get install -y cmake make git autoconf libtool libgmp-dev libgmp10
git clone --depth=1 --single-branch --branch v1.7.1 https://github.com/google/benchmark.git benchmark && mkdir -p benchmark/build && cd ./benchmark/build && cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=OFF ../ && make -j
sudo apt-get install -y libgtest-dev && cd /usr/src/gtest && sudo cmake CMakeLists.txt && sudo make && sudo cp lib/libgtest.a /usr/lib && sudo cp lib/libgtest_main.a /usr/lib && sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a && sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a
cd /cryptanalysislib
mkdir -p cmake-build-release
mkdir -p cmake-build-debug
cd cmake-build-debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
make -j
ctest -C Debug -V
cd ../cmake-build-release
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
ctest -C Debug -V
38 changes: 0 additions & 38 deletions .github/workflows/cmake.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/osx-x86.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: osx
env:
BUILD_TYPE: Release

on: [push]

jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
TARGET: x86_64-apple-darwin
COMPILER: clang
LINKER: clang

name: Build & test on ${{ matrix.os }} with ${{ matrix.compiler }}.
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Software (HomeBrew)
run: |
sudo rm -f /usr/local/bin/2to3
sudo rm -f /usr/local/bin/2to3-3.12
sudo rm -f /usr/local/bin/idle3
sudo rm -f /usr/local/bin/idle3.12
sudo rm -f /usr/local/bin/python
sudo rm -f /usr/local/bin/python3
sudo rm -f /usr/local/bin/python3.12
sudo rm -f /usr/local/bin/pydoc3
sudo rm -f /usr/local/bin/pydoc3.12
sudo rm -f /usr/local/bin/python3-config
sudo rm -f /usr/local/bin/python3.12-config
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install libomp llvm googletest google-benchmark
# - name: Install Google Benchmark
# run: git clone --depth=1 --single-branch --branch v1.8.3 https://github.com/google/benchmark.git benchmark && mkdir -p benchmark/build && cd ./benchmark/build && cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=OFF ../ && make -j
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -D CMAKE_CXX_COMPILER=$(brew --prefix llvm)/bin/clang++

- name: Build
run: cmake --build ${{github.workspace}}/build --config Debug

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C Debug -V
116 changes: 116 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: test

on: [push]

jobs:
build:
strategy:
matrix:
# ubuntu 20 doesnt support c++20
#os: [ubuntu-22.04, ubuntu-20.04]
os: [ubuntu-22.04]
# TODO currently not working. The CI does not find omp? Probably need
# to install the correct omp version for the correct compiler
# compiler: [ g++-10, clang++-11, clang++-12, clang++-13, clang++-14, clang++-15]
build_type: [Release, Debug]

name: Build & test on ${{ matrix.os }} with ${{ matrix.compiler }} in ${{ matrix.build_type }} mode.
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Software
run: |
sudo apt-get install -y libtbb-dev llvm-11 clang-11 llvm-12 clang-12 llvm-13 clang-13 llvm-14 clang-14 llvm-15 clang-15 gcc-10
# libomp-11-dev libomp-12-dev libomp-13-dev libomp-14-dev libomp-15-dev libomp5-11 libomp5-12 libomp5-13 libomp5-14 libomp5-15
- name: Install Google Benchmark
run: git clone --depth=1 --single-branch --branch v1.7.1 https://github.com/google/benchmark.git benchmark && mkdir -p benchmark/build && cd ./benchmark/build && cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=OFF ../ && make -j

- name: Install gtest
run:
sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake CMakeLists.txt && sudo make && sudo cp lib/libgtest.a /usr/lib && sudo cp lib/libgtest_main.a /usr/lib && sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a && sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a


- name: Configure CMake
# env:
# CXX: ${{ matrix.compiler }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C Debug -V


# Benchmark:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
#
# - name: Install Software
# run: |
# sudo apt-get install -y libmpfr-dev libpng-dev libtbb-dev
#
# - name: Configure CMake
# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
#
# - name: Install Google Benchmark
# run: git clone --depth=1 --single-branch --branch v1.7.1 https://github.com/google/benchmark.git benchmark && mkdir -p benchmark/build && cd ./benchmark/build && cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=OFF ../ && make -j
#
# - name: Install gtest
# run:
# sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake CMakeLists.txt && sudo make && sudo cp lib/libgtest.a /usr/lib && sudo cp lib/libgtest_main.a /usr/lib && sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a && sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a
#
# - name: Build
# run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}}
#
# - name: Bench
# run: cd build &&
# ./bench/container/bench_b63_container_get_bits -j | tee benchmark_bench_b63_container_get_bits.json &&
# ./bench/container/bench_b63_container_kAryPackedContainer -j | tee benchmark_bench_b63_container_kAryPackedContainer.json &&
#
# ./bench/label/bench_b63_label_add -j | tee benchmark_bench_b63_label_add.json &&
# ./bench/label/bench_b63_label_add_level -j | tee benchmark_bench_b63_label_add_level.json &&
# ./bench/label/bench_b63_label_equal_level -j | tee benchmark_bench_b63_label_equal_level.json &&
# ./bench/label/bench_b63_label_sub -j | tee benchmark_bench_b63_label_sub.json &&
# ./bench/label/bench_b63_label_sub_level -j | tee benchmark_bench_b63_label_sub_level.json &&
#
# ./bench/labeltype/bench_b63_labeltype_add -j | tee benchmark_bench_b63_labeltype_add.json &&
# ./bench/labeltype/bench_b63_labeltype_sub -j | tee benchmark_bench_b63_labeltype_sub.json &&
#
# ./bench/list/bench_b63_list_binarysearch -j | tee benchmark_bench_b63_list_binarysearchjson &&
# ./bench/list/bench_b63_list_search -j | tee benchmark_bench_b63_list_search.json &&
# ./bench/list/bench_b63_list_sort -j | tee benchmark_bench_b63_list_sort &&
#
# ./bench/matrix/bench_b63_matrix/gaus -j | tee benchmark_bench_b63_matrix_gaus &&
#
# ./bench/mem/bench_b63_mem_malloc_free -j | tee benchmark_bench_b63_mem_malloc_free.json &&
#
# ./bench/nn/bench_b63_nn_avx2 -j | tee benchmark_bench_b63_nn_avx2.json &&
# ./bench/nn/bench_b63_nn_bruteforce -j | tee benchmark_bench_b63_nn_bruteforce.json &&
# ./bench/nn/bench_b63_nn_n128_avx2 -j | tee benchmark_bench_b63_nn_n128_avx2.json &&
# ./bench/nn/bench_b63_nn_opt -j | tee benchmark_bench_b63_nn_opt.json &&
# ./bench/nn/bench_b63_nn_popcount -j | tee benchmark_bench_b63_nn_popcount.json &&
# ./bench/nn/bench_b63_nn_sort_nn_on32 -j | tee benchmark_bench_b63_nn_sort_nn_on32.json &&
# ./bench/nn/bench_b63_nn_sort_nn_on64 -j | tee benchmark_bench_b63_nn_sort_nn_on64.json &&
#
# ./bench/search/bench_b63_search_binarysearch -j | tee benchmark_bench_b63_search_binarysearch.json &&
# ./bench/search/bench_b63_search_internal_parallel_bucket_search -j | tee benchmark_bench_b63_search_internal_parallel_bucket_search.json &&
#
# ./bench/sort/bench_b63_sort_binarycontainer_single_limb -j | tee benchmark_bench_b63_sort_binarycontainer_single_limb.json &&
# ./bench/sort/bench_b63_sort_internal_parallel_bucket_sort -j | tee benchmark_bench_b63_sort_internal_parallel_bucket_sort.json &&
# ./bench/sort/bench_b63_sort_sort -j | tee benchmark_bench_b63_sort_sort.json &&
# ./bench/sort/bench_stl_stl -j | tee benchmark_bench_stl_stl.json &&
# ./bench/value/bench_b63_value_absolute -j | tee benchmark_bench_b63_value_absolute.json &&
# ./bench/value/bench_b63_value_add -j | tee benchmark_bench_b63_value_add.json &&
# ./bench/value/bench_b63_value_move_operator -j | tee benchmark_bench_b63_value_move_operator.json

8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,12 @@ link_directories("deps/cryptanalysislib/build")
link_directories("deps/cryptanalysislib/deps/m4ri/.libs")
link_directories("/usr/local/lib")

add_subdirectory(test)
add_subdirectory(bench)
if (benchmark_FOUND)
add_subdirectory(bench)
endif()
if (GTest_FOUND)
add_subdirectory(tests)
endif()

add_custom_target(
TOUCH
Expand Down
Loading

0 comments on commit 27f4e2d

Please sign in to comment.