From ea9b96f79a9d2554a84f228a4f58f56399136654 Mon Sep 17 00:00:00 2001 From: Alexander Lvov Date: Wed, 27 Nov 2024 20:30:25 +0200 Subject: [PATCH] Created workflow for testing as library. --- .github/workflows/benchmarks.yml | 2 +- .../workflows/build_multiple_platforms.yml | 38 +++++++++++++++++++ ci/{ => benchmarking}/example_benchmarks.json | 0 ci/{ => benchmarking}/make_plot.py | 0 ci/{ => benchmarking}/update_image_link.py | 0 ci/build/CMakeLists.txt | 12 ++++++ ci/build/main.cpp | 8 ++++ 7 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_multiple_platforms.yml rename ci/{ => benchmarking}/example_benchmarks.json (100%) rename ci/{ => benchmarking}/make_plot.py (100%) rename ci/{ => benchmarking}/update_image_link.py (100%) create mode 100644 ci/build/CMakeLists.txt create mode 100644 ci/build/main.cpp diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index f566c80..341e4c1 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -20,7 +20,7 @@ jobs: id: strings shell: bash run: | - echo "ci=${{ github.workspace }}/ci" >> "$GITHUB_OUTPUT" + echo "ci=${{ github.workspace }}/ci/benchmarking" >> "$GITHUB_OUTPUT" echo "benchmark=${{ github.workspace }}/benchmark" >> "$GITHUB_OUTPUT" echo "build=${{ github.workspace }}/benchmark/cmake-build-release" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/build_multiple_platforms.yml b/.github/workflows/build_multiple_platforms.yml new file mode 100644 index 0000000..c1acd48 --- /dev/null +++ b/.github/workflows/build_multiple_platforms.yml @@ -0,0 +1,38 @@ +name: Build as library + +on: + push: + branches: [ "main" ] + +jobs: + Test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set reusable strings + id: strings + shell: bash + run: | + echo "build=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Create directory + run: mkdir ${{ steps.strings.outputs.build }} + + - name: Load CMake configuration + working-directory: ${{ steps.strings.outputs.build }} + run: cmake -B ${{ steps.strings.outputs.build }} + -DCMAKE_CXX_COMPILER=g++ + -DCMAKE_C_COMPILER=gcc + -DCMAKE_BUILD_TYPE=Release + -S ${{ github.workspace }} + + - name: Test + working-directory: ${{ steps.strings.outputs.build }} + run: | + make -j8 + ./Build + + + diff --git a/ci/example_benchmarks.json b/ci/benchmarking/example_benchmarks.json similarity index 100% rename from ci/example_benchmarks.json rename to ci/benchmarking/example_benchmarks.json diff --git a/ci/make_plot.py b/ci/benchmarking/make_plot.py similarity index 100% rename from ci/make_plot.py rename to ci/benchmarking/make_plot.py diff --git a/ci/update_image_link.py b/ci/benchmarking/update_image_link.py similarity index 100% rename from ci/update_image_link.py rename to ci/benchmarking/update_image_link.py diff --git a/ci/build/CMakeLists.txt b/ci/build/CMakeLists.txt new file mode 100644 index 0000000..ef99fb0 --- /dev/null +++ b/ci/build/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.26) +set(CMAKE_CXX_STANDARD 20) +project(Build) + +include(FetchContent) +FetchContent_Declare(AesiMultiprecision + GIT_REPOSITORY https://github.com/Alvov1/Aesi-Multiprecision.git + GIT_TAG main) +FetchContent_MakeAvailable(AesiMultiprecision) + +add_executable(Build main.cpp) +target_include_directories(Build PRIVATE ${AesiMultiprecision_SOURCE_DIR}) \ No newline at end of file diff --git a/ci/build/main.cpp b/ci/build/main.cpp new file mode 100644 index 0000000..1f4a78a --- /dev/null +++ b/ci/build/main.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() { + const Aeu512 number = "0xffff'ffff'ffff'ffff'ffff'ffff'ffff'ffff'ffff'ffff"; + std::cout << std::hex << std::showbase << number << std::endl; + return 0; +} \ No newline at end of file