Skip to content

Commit

Permalink
Add CI step to run performance regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
feliwir committed Feb 20, 2023
1 parent 5c71c6e commit c774f22
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 8 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: bench-linux

on:
pull_request:
push:

jobs:
create_release:
runs-on: ubuntu-20.04
steps:
- name: Create Development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/develop' }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"

build_thyme_ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y libgtk-3-dev ninja-build libwxgtk3.0-gtk3-dev libsdl2-dev libavcodec-dev libavformat-dev
- name: Configure Thyme
run: |
cmake -DSTANDALONE=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_BENCHMARKS=ON -B build -G Ninja
- name: Build Thyme
run: |
cmake --build build
- name: Bench Thyme
run: |
cd build
./thyme_benchmarks --benchmark_format=json | tee benchmark_result.json
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'googlecpp'
output-file-path: build/benchmark_result.json
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,16 @@ if(DLL_INSTALL_PREFIX AND ${CMAKE_VERSION} VERSION_GREATER "3.13.0")
endif()

# Build tests
if(BUILD_TESTS OR BUILD_BENCHMARKS)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
)

FetchContent_MakeAvailable(googletest)
endif()

if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
Expand Down
8 changes: 0 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
)

FetchContent_MakeAvailable(googletest)

set(TEST_SRCS
main.cpp
globals.cpp
Expand Down

0 comments on commit c774f22

Please sign in to comment.