Skip to content

Commit 443c5aa

Browse files
authored
ci: add macOS and benchmark workflows
2 parents 53a9eff + 2d64fb1 commit 443c5aa

3 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/CI-macOS.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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: |
25+
brew update
26+
brew uninstall --ignore-dependencies cmake || true
27+
brew install cmake
28+
- name: Configure
29+
run: cmake -S . -B build -DBUILD_TESTS=ON -DCMAKE_CXX_STANDARD=${{ matrix.std }}
30+
- name: Build
31+
run: cmake --build build
32+
- name: Run tests
33+
run: cd build && ctest --output-on-failure
34+
vcpkg:
35+
runs-on: macos-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Install vcpkg
39+
run: |
40+
git clone https://github.com/microsoft/vcpkg.git
41+
./vcpkg/bootstrap-vcpkg.sh
42+
./vcpkg/vcpkg install gtest
43+
- name: Configure
44+
run: cmake -S . -B build -DBUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=./vcpkg/scripts/buildsystems/vcpkg.cmake
45+
- name: Build
46+
run: cmake --build build
47+
- name: Run tests
48+
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)