Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon committed Mar 24, 2024
1 parent 5d1b162 commit 0a52779
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: C++ CI

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: amd64
- os: ubuntu-latest
arch: arm64

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
if: matrix.arch == 'arm64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake g++ git

- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build build -j 4

- name: Run benchmarks
run: ./build/BenchMath
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/google/benchmark.git
GIT_TAG v1.8.3
)
set(BENCHMARK_ENABLE_TESTING OFF)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
FetchContent_MakeAvailable(googlebenchmark)

Expand All @@ -31,4 +32,4 @@ FetchContent_Declare(
FetchContent_MakeAvailable(glm)

add_executable(BenchMath main.cpp)
target_link_libraries(BenchMath benchmark::benchmark Eigen3::Eigen glm)
target_link_libraries(BenchMath benchmark::benchmark Eigen3::Eigen glm)

0 comments on commit 0a52779

Please sign in to comment.