-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update compiler version in github action
Optimize benchmark cost
- Loading branch information
Showing
9 changed files
with
99 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,77 @@ | ||
# setup @see https://help.github.com/en/articles/workflow-syntax-for-github-actions | ||
# environment @see https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions | ||
# https://help.github.com/en/articles/virtual-environments-for-github-actions | ||
# example @see https://github.com/actions/toolkit/blob/master/.github/workflows/workflow.yml | ||
name: Linux Building | ||
# This workflow is triggered on pushes to the repository. | ||
on: # @see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events | ||
push: | ||
branches: # Array of patterns that match refs/heads | ||
# - master # Push events on master branch | ||
- dev | ||
# schedule: | ||
# - cron: 0 * * * * | ||
|
||
jobs: | ||
build: # job id, can be any string | ||
# Job name is Build And Publish | ||
name: Build And Publish | ||
# This job runs on Linux | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
cc: | ||
# - clang-6.0 | ||
# - clang-9 | ||
- gcc | ||
- gcc-9 | ||
- shared:gcc-9 | ||
- no-exceptions:gcc-9 | ||
- thread-unsafe:gcc-9 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master # https://github.com/actions/actions | ||
- name: Build | ||
shell: bash | ||
run: | | ||
PROJECT_ADDON_OPTIONS=() | ||
USE_CC=${{ matrix.cc }} | ||
if [[ "x${USE_CC:0:14}" == "xno-exceptions:" ]]; then | ||
USE_CC=${USE_CC:14} | ||
PROJECT_ADDON_OPTIONS=(${PROJECT_ADDON_OPTIONS[@]} "-DCMAKE_CXX_FLAGS=-fno-exceptions") | ||
fi | ||
if [[ "x${USE_CC:0:7}" == "xshared:" ]]; then | ||
USE_CC=${USE_CC:7} | ||
PROJECT_ADDON_OPTIONS=(${PROJECT_ADDON_OPTIONS[@]} "-DBUILD_SHARED_LIBS=ON") | ||
fi | ||
if [[ "x${USE_CC:0:14}" == "xthread-unsafe:" ]]; then | ||
USE_CC=${USE_CC:14} | ||
PROJECT_ADDON_OPTIONS=(${PROJECT_ADDON_OPTIONS[@]} "-DLIBCOPP_DISABLE_ATOMIC_LOCK=ON" "-DLIBCOPP_DISABLE_THIS_MT=ON") | ||
fi | ||
USE_CXX="$(echo $USE_CC | rev | sed -e 's/gnalc/++gnalc/' | rev)" # clang -> clang++ | ||
USE_CXX="$(echo $USE_CXX | rev | sed -e 's/ccg/++g/' | rev)" # gcc -> g++ | ||
mkdir -p "$GITHUB_WORKSPACE/build_jobs_dir_linux" | ||
cd "$GITHUB_WORKSPACE/build_jobs_dir_linux" | ||
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX ${PROJECT_ADDON_OPTIONS[@]} | ||
cmake --build . -j | ||
- name: Sample and Tests | ||
shell: bash | ||
run: | | ||
cd "$GITHUB_WORKSPACE/build_jobs_dir_linux" | ||
ORIGIN_CC=${{ matrix.cc }} | ||
if [ "x${ORIGIN_CC:0:14}" == "xno-exceptions:" ]; then | ||
ORIGIN_CC=${ORIGIN_CC:14} | ||
fi | ||
if [ "x${ORIGIN_CC:0:7}" == "xshared:" ]; then | ||
ORIGIN_CC=${ORIGIN_CC:7} | ||
fi | ||
if [ "x${ORIGIN_CC:0:14}" == "xthread-unsafe:" ]; then | ||
ORIGIN_CC=${ORIGIN_CC:14} | ||
echo "============================== run benchmark ==============================" | ||
cmake --build . -- benchmark | ||
else | ||
echo "============================== run sample,test,benchmark ==============================" | ||
cmake --build . -- run_sample run_test benchmark | ||
fi | ||
rm -rf * | ||
# setup @see https://help.github.com/en/articles/workflow-syntax-for-github-actions | ||
# environment @see https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions | ||
# https://help.github.com/en/articles/virtual-environments-for-github-actions | ||
# example @see https://github.com/actions/toolkit/blob/master/.github/workflows/workflow.yml | ||
name: Linux Building | ||
# This workflow is triggered on pushes to the repository. | ||
on: # @see https://help.github.com/en/articles/events-that-trigger-workflows#webhook-events | ||
push: | ||
branches: # Array of patterns that match refs/heads | ||
# - master # Push events on master branch | ||
- dev | ||
# schedule: | ||
# - cron: 0 * * * * | ||
|
||
jobs: | ||
build: # job id, can be any string | ||
# Job name is Build And Publish | ||
name: Build And Publish | ||
# This job runs on Linux | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
cc: | ||
# - clang-6.0 | ||
# - clang-9 | ||
- gcc | ||
- gcc-10 | ||
- shared:gcc-10 | ||
- no-exceptions:gcc-10 | ||
- thread-unsafe:gcc-10 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master # https://github.com/actions/actions | ||
- name: Build | ||
shell: bash | ||
run: | | ||
PROJECT_ADDON_OPTIONS=() | ||
USE_CC=${{ matrix.cc }} | ||
if [[ "x${USE_CC:0:14}" == "xno-exceptions:" ]]; then | ||
USE_CC=${USE_CC:14} | ||
PROJECT_ADDON_OPTIONS=(${PROJECT_ADDON_OPTIONS[@]} "-DCMAKE_CXX_FLAGS=-fno-exceptions") | ||
fi | ||
if [[ "x${USE_CC:0:7}" == "xshared:" ]]; then | ||
USE_CC=${USE_CC:7} | ||
PROJECT_ADDON_OPTIONS=(${PROJECT_ADDON_OPTIONS[@]} "-DBUILD_SHARED_LIBS=ON") | ||
fi | ||
if [[ "x${USE_CC:0:14}" == "xthread-unsafe:" ]]; then | ||
USE_CC=${USE_CC:14} | ||
PROJECT_ADDON_OPTIONS=(${PROJECT_ADDON_OPTIONS[@]} "-DLIBCOPP_DISABLE_ATOMIC_LOCK=ON" "-DLIBCOPP_DISABLE_THIS_MT=ON") | ||
fi | ||
USE_CXX="$(echo $USE_CC | rev | sed -e 's/gnalc/++gnalc/' | rev)" # clang -> clang++ | ||
USE_CXX="$(echo $USE_CXX | rev | sed -e 's/ccg/++g/' | rev)" # gcc -> g++ | ||
mkdir -p "$GITHUB_WORKSPACE/build_jobs_dir_linux" | ||
cd "$GITHUB_WORKSPACE/build_jobs_dir_linux" | ||
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBCOPP_FCONTEXT_USE_TSX=ON -DPROJECT_ENABLE_UNITTEST=ON -DPROJECT_ENABLE_SAMPLE=ON -DCMAKE_C_COMPILER=$USE_CC -DCMAKE_CXX_COMPILER=$USE_CXX ${PROJECT_ADDON_OPTIONS[@]} | ||
cmake --build . -j | ||
- name: Sample and Tests | ||
shell: bash | ||
run: | | ||
cd "$GITHUB_WORKSPACE/build_jobs_dir_linux" | ||
ORIGIN_CC=${{ matrix.cc }} | ||
if [ "x${ORIGIN_CC:0:14}" == "xno-exceptions:" ]; then | ||
ORIGIN_CC=${ORIGIN_CC:14} | ||
fi | ||
if [ "x${ORIGIN_CC:0:7}" == "xshared:" ]; then | ||
ORIGIN_CC=${ORIGIN_CC:7} | ||
fi | ||
if [ "x${ORIGIN_CC:0:14}" == "xthread-unsafe:" ]; then | ||
ORIGIN_CC=${ORIGIN_CC:14} | ||
echo "============================== run benchmark ==============================" | ||
cmake --build . -- benchmark | ||
else | ||
echo "============================== run sample,test,benchmark ==============================" | ||
cmake --build . -- run_sample run_test benchmark | ||
fi | ||
rm -rf * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters