Skip to content

Commit ed7f22d

Browse files
committed
ci: add macOS and benchmark workflows
1 parent 258c1e7 commit ed7f22d

3 files changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/CI-macOS.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI-macOS
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/**
8+
- stable
9+
pull_request:
10+
branches:
11+
- main
12+
- release/**
13+
- codex/**
14+
15+
jobs:
16+
Tests-macOS:
17+
runs-on: macos-latest
18+
strategy:
19+
matrix:
20+
std: [11, 17]
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Install dependencies
24+
run: brew update && brew install cmake
25+
- name: Configure
26+
run: cmake -S . -B build -DBUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }}
27+
- name: Build
28+
run: cmake --build build
29+
- name: Run tests
30+
run: cd build && ctest --output-on-failure
31+
vcpkg:
32+
runs-on: macos-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Install vcpkg
36+
run: |
37+
git clone https://github.com/microsoft/vcpkg.git
38+
./vcpkg/bootstrap-vcpkg.sh
39+
./vcpkg/vcpkg install gtest
40+
- name: Configure
41+
run: cmake -S . -B build -DBUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
42+
- name: Build
43+
run: cmake --build build
44+
- name: Run tests
45+
run: cd build && ctest --output-on-failure

.github/workflows/benchmarks.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
benchmark:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Install dependencies
14+
run: sudo apt-get update && sudo apt-get install -y cmake hyperfine
15+
- name: Run benchmarks
16+
run: scripts/run_benchmarks.sh

scripts/run_benchmarks.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
cmake -S . -B build-bench -DCMAKE_BUILD_TYPE=Release
5+
cmake --build build-bench --config Release
6+
hyperfine "./build-bench/example"

0 commit comments

Comments
 (0)