Skip to content

Commit 5cdd92f

Browse files
committed
Add CI step to run performance regression test
1 parent 5c71c6e commit 5cdd92f

File tree

3 files changed

+68
-8
lines changed

3 files changed

+68
-8
lines changed

.github/workflows/bench.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: bench-linux
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
permissions:
8+
# deployments permission to deploy GitHub pages website
9+
deployments: write
10+
# contents permission to update benchmark contents in gh-pages branch
11+
contents: write
12+
13+
jobs:
14+
create_release:
15+
runs-on: ubuntu-20.04
16+
steps:
17+
- name: Create Development release
18+
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }}
19+
uses: "marvinpinto/action-automatic-releases@latest"
20+
with:
21+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
22+
automatic_release_tag: "latest"
23+
prerelease: true
24+
title: "Development Build"
25+
26+
build_thyme_ubuntu:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
with:
32+
submodules: "recursive"
33+
34+
- name: Install dependencies
35+
run: |
36+
sudo apt-get update && sudo apt-get install -y libgtk-3-dev ninja-build libwxgtk3.0-gtk3-dev libsdl2-dev libavcodec-dev libavformat-dev
37+
38+
- name: Configure Thyme
39+
run: |
40+
cmake -DSTANDALONE=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_BENCHMARKS=ON -B build -G Ninja
41+
42+
- name: Build Thyme
43+
run: |
44+
cmake --build build
45+
46+
- name: Bench Thyme
47+
run: |
48+
cd build
49+
./thyme_benchmarks --benchmark_format=json | tee benchmark_result.json
50+
51+
- name: Store benchmark result
52+
uses: benchmark-action/github-action-benchmark@v1
53+
with:
54+
name: Thyme Benchmarks
55+
tool: 'googlecpp'
56+
output-file-path: build/benchmark_result.json
57+
github-token: ${{ secrets.GITHUB_TOKEN }}
58+
auto-push: true

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,16 @@ if(DLL_INSTALL_PREFIX AND ${CMAKE_VERSION} VERSION_GREATER "3.13.0")
417417
endif()
418418

419419
# Build tests
420+
if(BUILD_TESTS OR BUILD_BENCHMARKS)
421+
FetchContent_Declare(
422+
googletest
423+
GIT_REPOSITORY https://github.com/google/googletest.git
424+
GIT_TAG release-1.12.1
425+
)
426+
427+
FetchContent_MakeAvailable(googletest)
428+
endif()
429+
420430
if(BUILD_TESTS)
421431
enable_testing()
422432
add_subdirectory(tests)

tests/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
FetchContent_Declare(
2-
googletest
3-
GIT_REPOSITORY https://github.com/google/googletest.git
4-
GIT_TAG release-1.12.1
5-
)
6-
7-
FetchContent_MakeAvailable(googletest)
8-
91
set(TEST_SRCS
102
main.cpp
113
globals.cpp

0 commit comments

Comments
 (0)