Skip to content

Commit c774f22

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

File tree

3 files changed

+59
-8
lines changed

3 files changed

+59
-8
lines changed

.github/workflows/bench.yml

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

CMakeLists.txt

+10
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

-8
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)