1
0

chore: update yycc gh action build script

This commit is contained in:
2026-02-03 15:03:30 +08:00
parent b51ded2101
commit a0f032c28b
13 changed files with 142 additions and 84 deletions

4
.github/scripts/README.md vendored Normal file
View File

@@ -0,0 +1,4 @@
# GitHub Action Scripts
These script files are only used for GitHub Action.
These script files should only be executed in their root directory respectively.

17
.github/scripts/gbenchmark/linux.sh vendored Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
# Create build and install directory
mkdir build install
# Build project
cd build
cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
cmake --install . --prefix=../install
cd ..
# Record install directory
cd install
export benchmark_ROOT=$(pwd)
cd ..

17
.github/scripts/gbenchmark/macos.sh vendored Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
# Create build and install directory
mkdir build install
# Build project
cd build
cmake -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
cmake --install . --prefix=../install
cd ..
# Record install directory
cd install
export benchmark_ROOT=$(pwd)
cd ..

17
.github/scripts/gbenchmark/windows.bat vendored Normal file
View File

@@ -0,0 +1,17 @@
@ECHO OFF
:: Create build and install directory
MKDIR build
MKDIR install
:: Build project
CD build
cmake -A x64 -DCMAKE_CXX_STANDARD=23 -DBENCHMARK_ENABLE_TESTING=OFF ..
cmake --build . --config Release
cmake --install . --prefix=../install --config Release
CD ..
:: Record install directory
CD install
SET benchmark_ROOT=%CD%
CD ..

17
.github/scripts/gtest/linux.sh vendored Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
# Create build and install directory
mkdir build install
# Build project
cd build
cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
cmake --install . --prefix=../install
cd ..
# Record install directory
cd install
export GTest_ROOT=$(pwd)
cd ..

17
.github/scripts/gtest/macos.sh vendored Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -euo pipefail
# Create build and install directory
mkdir build install
# Build project
cd build
cmake -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
cmake --install . --prefix=../install
cd ..
# Record install directory
cd install
export GTest_ROOT=$(pwd)
cd ..

17
.github/scripts/gtest/windows.bat vendored Normal file
View File

@@ -0,0 +1,17 @@
@ECHO OFF
:: Create build and install directory
MKDIR build
MKDIR install
:: Build project
CD build
cmake -A x64 -DCMAKE_CXX_STANDARD=23 -Dgtest_force_shared_crt=ON ..
cmake --build . --config Release
cmake --install . --prefix=../install --config Release
CD ..
:: Record install directory
CD install
SET GTest_ROOT=%CD%
CD ..

19
.github/scripts/linux.sh vendored Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -euo pipefail
# Create build directory and enter it
mkdir bin
cd bin
# Create internal build and install directory, then enter it
mkdir build
mkdir install
# Build in Release mode
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DYYCC_BUILD_TEST=ON -DGTest_ROOT=$GTest_ROOT -DYYCC_BUILD_BENCHMARK=ON -Dbenchmark_ROOT=$benchmark_ROOT ../..
cmake --build .
cmake --install . --prefix=../install
cd ..
# Back to root directory
cd ..

19
.github/scripts/macos.sh vendored Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -euo pipefail
# Create build directory and enter it
mkdir bin
cd bin
# Create internal build and install directory, then enter it
mkdir build
mkdir install
# Build in Release mode
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DYYCC_BUILD_TEST=ON -DGTest_ROOT=$GTest_ROOT -DYYCC_BUILD_BENCHMARK=ON -Dbenchmark_ROOT=$benchmark_ROOT ../..
cmake --build .
cmake --install . --prefix=../install
cd ..
# Back to root directory
cd ..

18
.github/scripts/windows.bat vendored Normal file
View File

@@ -0,0 +1,18 @@
@ECHO OFF
:: Create build directory and enter it
MKDIR bin
CD bin
:: Create internal build and install directory, then enter it
MKDIR build
MKDIR install
:: Build with x64 architecture in Release mode
CD build
cmake -A x64 -DYYCC_BUILD_TEST=ON -DGTest_ROOT=%GTest_ROOT% -DYYCC_BUILD_BENCHMARK=ON -Dbenchmark_ROOT=%benchmark_ROOT% ../..
cmake --build . --config Release
cmake --install . --prefix=../install --config Release
CD ..
:: Back to root directory
CD ..