chore: update github build script.
- enable gtest and benchmark build. - allow install gtest and benchmark binary. - add test and benchmark step in github action.
This commit is contained in:
56
.github/workflows/linux.yml
vendored
56
.github/workflows/linux.yml
vendored
@@ -13,32 +13,44 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y build-essential cmake git
|
sudo apt install -y build-essential cmake git
|
||||||
# - name: Setup Google Test and Google Benchmark
|
- name: Setup Google Test and Google Benchmark
|
||||||
# run: |
|
run: |
|
||||||
# # Setup Google Test
|
# Setup Google Test
|
||||||
# git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest
|
git clone -b v1.17.0 https://github.com/google/googletest.git --depth 1 extern/googletest
|
||||||
# cd extern/googletest
|
cd extern/googletest
|
||||||
# mkdir build install
|
mkdir build install
|
||||||
# cd build
|
cd build
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||||
# cmake --build .
|
cmake --build .
|
||||||
# cmake --install . --prefix=../install
|
cmake --install . --prefix=../install
|
||||||
# cd ../..
|
cd ..
|
||||||
# # Setup Google Benchmark
|
cd install
|
||||||
# git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark
|
export GTest_ROOT=$(pwd)
|
||||||
# cd extern/benchmark
|
cd ../..
|
||||||
# # Create symlink to googletest as required by benchmark
|
# Setup Google Benchmark
|
||||||
# ln -s ../googletest googletest
|
git clone -b v1.9.4 https://github.com/google/benchmark.git --depth 1 extern/benchmark
|
||||||
# mkdir build install
|
cd extern/benchmark
|
||||||
# cd build
|
# Create symlink to googletest as required by benchmark
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
|
ln -s ../googletest googletest
|
||||||
# cmake --build .
|
mkdir build install
|
||||||
# cmake --install . --prefix=../install
|
cd build
|
||||||
# cd ../..
|
cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
cmake --build .
|
||||||
|
cmake --install . --prefix=../install
|
||||||
|
cd ..
|
||||||
|
cd install
|
||||||
|
export benchmark_ROOT=$(pwd)
|
||||||
|
cd ../..
|
||||||
- name: Build YYCC
|
- name: Build YYCC
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./.github/linux_build.sh
|
chmod +x ./.github/linux_build.sh
|
||||||
./.github/linux_build.sh
|
./.github/linux_build.sh
|
||||||
|
- name: Run YYCC Test
|
||||||
|
run: |
|
||||||
|
./bin/install/bin/YYCCTest
|
||||||
|
- name: Run YYCC Benchmark
|
||||||
|
run: |
|
||||||
|
./bin/install/bin/YYCCBenchmark
|
||||||
- name: Upload Built Artifact
|
- name: Upload Built Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
56
.github/workflows/macos.yml
vendored
56
.github/workflows/macos.yml
vendored
@@ -9,32 +9,44 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
# - name: Setup Google Test and Google Benchmark
|
- name: Setup Google Test and Google Benchmark
|
||||||
# run: |
|
run: |
|
||||||
# # Setup Google Test
|
# Setup Google Test
|
||||||
# git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest
|
git clone -b v1.17.0 https://github.com/google/googletest.git --depth 1 extern/googletest
|
||||||
# cd extern/googletest
|
cd extern/googletest
|
||||||
# mkdir build install
|
mkdir build install
|
||||||
# cd build
|
cd build
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||||
# cmake --build .
|
cmake --build .
|
||||||
# cmake --install . --prefix=../install
|
cmake --install . --prefix=../install
|
||||||
# cd ../..
|
cd ..
|
||||||
# # Setup Google Benchmark
|
cd install
|
||||||
# git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark
|
export GTest_ROOT=$(pwd)
|
||||||
# cd extern/benchmark
|
cd ../..
|
||||||
# # Create symlink to googletest as required by benchmark
|
# Setup Google Benchmark
|
||||||
# ln -s ../googletest googletest
|
git clone -b v1.9.4 https://github.com/google/benchmark.git --depth 1 extern/benchmark
|
||||||
# mkdir build install
|
cd extern/benchmark
|
||||||
# cd build
|
# Create symlink to googletest as required by benchmark
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
|
ln -s ../googletest googletest
|
||||||
# cmake --build .
|
mkdir build install
|
||||||
# cmake --install . --prefix=../install
|
cd build
|
||||||
# cd ../..
|
cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
cmake --build .
|
||||||
|
cmake --install . --prefix=../install
|
||||||
|
cd ..
|
||||||
|
cd install
|
||||||
|
export benchmark_ROOT=$(pwd)
|
||||||
|
cd ../..
|
||||||
- name: Build YYCC
|
- name: Build YYCC
|
||||||
run: |
|
run: |
|
||||||
chmod +x ./.github/macos_build.sh
|
chmod +x ./.github/macos_build.sh
|
||||||
./.github/macos_build.sh
|
./.github/macos_build.sh
|
||||||
|
- name: Run YYCC Test
|
||||||
|
run: |
|
||||||
|
./bin/install/bin/YYCCTest
|
||||||
|
- name: Run YYCC Benchmark
|
||||||
|
run: |
|
||||||
|
./bin/install/bin/YYCCBenchmark
|
||||||
- name: Upload Built Artifact
|
- name: Upload Built Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
58
.github/workflows/windows.yml
vendored
58
.github/workflows/windows.yml
vendored
@@ -16,28 +16,34 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
# - name: Setup Google Test and Google Benchmark
|
- name: Setup Google Test and Google Benchmark
|
||||||
# run: |
|
run: |
|
||||||
# # Setup Google Test
|
# Setup Google Test
|
||||||
# git clone -b v1.17.0 https://github.com/google/googletest.git extern/googletest
|
git clone -b v1.17.0 https://github.com/google/googletest.git --depth 1 extern/googletest
|
||||||
# cd extern/googletest
|
cd extern/googletest
|
||||||
# mkdir build install
|
mkdir build install
|
||||||
# cd build
|
cd build
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
|
||||||
# cmake --build . --config Release
|
cmake --build . --config Release
|
||||||
# cmake --install . --prefix=../install --config Release
|
cmake --install . --prefix=../install --config Release
|
||||||
# cd ../..
|
cd ..
|
||||||
# # Setup Google Benchmark
|
cd install
|
||||||
# git clone -b v1.9.4 https://github.com/google/benchmark.git extern/benchmark
|
set GTest_ROOT=%CD%
|
||||||
# cd extern/benchmark
|
cd ../..
|
||||||
# # Create symlink to googletest as required by benchmark
|
# Setup Google Benchmark
|
||||||
# mklink /D googletest ../googletest
|
git clone -b v1.9.4 https://github.com/google/benchmark.git --depth 1 extern/benchmark
|
||||||
# mkdir build install
|
cd extern/benchmark
|
||||||
# cd build
|
# Create symlink to googletest as required by benchmark
|
||||||
# cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
|
mklink /D googletest ../googletest
|
||||||
# cmake --build . --config Release
|
mkdir build install
|
||||||
# cmake --install . --prefix=../install --config Release
|
cd build
|
||||||
# cd ../..
|
cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
cmake --build . --config Release
|
||||||
|
cmake --install . --prefix=../install --config Release
|
||||||
|
cd ..
|
||||||
|
cd install
|
||||||
|
set benchmark_ROOT=%CD%
|
||||||
|
cd ../..
|
||||||
- name: Build YYCC
|
- name: Build YYCC
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
@@ -46,6 +52,14 @@ jobs:
|
|||||||
if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
|
if not exist %VCVARS% set VCVARS="C:\Program Files\Microsoft Visual Studio\%VS%\Enterprise\VC\Auxiliary\Build\vcvarsall.bat"
|
||||||
call %VCVARS% ${{ matrix.msvc_arch }}
|
call %VCVARS% ${{ matrix.msvc_arch }}
|
||||||
.\.github\windows_build.bat
|
.\.github\windows_build.bat
|
||||||
|
- name: Run YYCC Test
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
.\bin\install\bin\YYCCTest.exe
|
||||||
|
- name: Run YYCC Benchmark
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
.\bin\install\bin\YYCCBenchmark.exe
|
||||||
- name: Upload Built Artifact
|
- name: Upload Built Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -26,3 +26,8 @@ PRIVATE
|
|||||||
YYCCommonplace
|
YYCCommonplace
|
||||||
benchmark::benchmark
|
benchmark::benchmark
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Install binary
|
||||||
|
install(TARGETS YYCCBenchmark
|
||||||
|
RUNTIME DESTINATION ${YYCC_INSTALL_BIN_PATH}
|
||||||
|
)
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ PRIVATE
|
|||||||
GTest::gtest_main
|
GTest::gtest_main
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Install binary
|
||||||
|
install(TARGETS YYCCTest
|
||||||
|
RUNTIME DESTINATION ${YYCC_INSTALL_BIN_PATH}
|
||||||
|
)
|
||||||
|
|
||||||
# Discover all test
|
# Discover all test
|
||||||
include(GoogleTest)
|
include(GoogleTest)
|
||||||
gtest_discover_tests(YYCCTest)
|
gtest_discover_tests(YYCCTest)
|
||||||
|
|||||||
Reference in New Issue
Block a user