diff --git a/.github/workflows/validate-cpp.yml b/.github/workflows/validate-cpp.yml index bb6257bde5..0409aac46d 100644 --- a/.github/workflows/validate-cpp.yml +++ b/.github/workflows/validate-cpp.yml @@ -66,14 +66,21 @@ jobs: with: toolchain: ${{ matrix.toolchain }} - - name: Build benchmark + - name: Build and run benchmark + run: ./benchmark + working-directory: benchmark + + - name: ls run: | - cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release - cmake --build build + ls + ls build working-directory: benchmark - - name: Run benchmarklegacy - run: ./build/benchmarklegacy + - name: Build and run benchmarklegacy + run: | + cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release + cmake --build build + ./build/benchmarklegacy working-directory: benchmark capture: diff --git a/benchmark/benchmark b/benchmark/benchmark new file mode 100755 index 0000000000..5748e13bcf --- /dev/null +++ b/benchmark/benchmark @@ -0,0 +1,15 @@ +#!/bin/sh +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +cd "$(dirname "$0")" || exit +CAPTURES_PATH="$(dirname "$(realpath "$0")")""/captures" + +if [ "$1" = "buck" ]; then + buck run @fbcode/mode/opt :benchmarkCXX "${CAPTURES_PATH}" +else + cmake -B build -S . -D CMAKE_BUILD_TYPE=Release + cmake --build build + build/benchmark "${CAPTURES_PATH}" +fi