Skip to content

Commit

Permalink
release version v0.8.1
Browse files Browse the repository at this point in the history
Signed-off-by: Certseeds <[email protected]>
  • Loading branch information
Certseeds committed Apr 17, 2022
2 parents 02b7905 + 8320d25 commit 1ebae62
Show file tree
Hide file tree
Showing 533 changed files with 178,475 additions and 21,833 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: daily build

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
schedule:
- cron: '0 15 * * *'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
name: daily build
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-18.04, ubuntu-latest ]
gcc_v: [ 11 ] # Version of G++,GCC
env:
GCC_V: ${{ matrix.gcc_v }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout code
uses: actions/checkout@v2
with:
ref: dev
- uses: actions/cache@v3
env:
cache-name: cache-cmake-files
with:
path: ~/.ccache
key: ${{ matrix.os }}-cmake-build-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ matrix.os }}-cmake-build
${{ matrix.os }}
# ensure the path and files of project
- name: ensure the path and files of project
run: sudo apt-get install tree; tree

- name: Install GCC-11,G++-11, ccache
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update && sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V} ccache
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 111
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} 111
- name: prepare libopencv
run: |
sudo apt-get update && sudo apt-get install libopencv-dev
- name: Use cmake
run: cmake --version

- name: cmake prepare for compile
run: cmake -S . -B ./CMAKE_DEBUG_PATH -DCMAKE_BUILD_TYPE=DEBUG -DMULTIPLY_TIMES=1

- name: cmake compile lab_00
working-directory: ./CMAKE_DEBUG_PATH/lab_00
run: cmake --build . --config DEBUG --parallel

- name: cmake compile algorithm/2021F
working-directory: ./CMAKE_DEBUG_PATH/algorithm/2021F
run: cmake --build . --config DEBUG --parallel

- name: cmake compile algorithm/matrix
working-directory: ./CMAKE_DEBUG_PATH/algorithm/matrix
run: cmake --build . --config DEBUG --parallel

- name: cmake compile algorithm
working-directory: ./CMAKE_DEBUG_PATH/algorithm/
run: cmake --build .

- name: cmake compile basic
working-directory: ./CMAKE_DEBUG_PATH/basic
run: cmake --build . --config DEBUG --parallel

- name: cmake compile
working-directory: ./CMAKE_DEBUG_PATH
run: cmake --build . --config DEBUG --parallel

- name: cmake test
working-directory: ./CMAKE_DEBUG_PATH
run: ctest --parallel $(nproc)

- name: cache configs output
run: |
ccache -p
ccache -s
33 changes: 20 additions & 13 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ on:
push:
branches-ignore:
- 'release'
pull_request:
branches-ignore:
- 'release'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
Expand All @@ -17,7 +15,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-18.04, ubuntu-latest, windows-latest ]
os: [ ubuntu-18.04, ubuntu-latest ]
gcc_v: [ 11 ] # Version of G++,GCC
env:
GCC_V: ${{ matrix.gcc_v }}
Expand All @@ -27,6 +25,15 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout code
uses: actions/checkout@v2
- uses: actions/cache@v3
env:
cache-name: cache-cmake-files
with:
path: ~/.ccache
key: ${{ matrix.os }}-cmake-build-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ matrix.os }}-cmake-build
${{ matrix.os }}
- name: hardwares - cpu
run: nproc; cat /proc/cpuinfo
Expand All @@ -35,12 +42,11 @@ jobs:
# ensure the path and files of project
- name: ensure the path and files of project
run: sudo apt-get install tree; tree
if: ${{matrix.os != 'windows-latest'}}

- name: Install GCC-11,G++-11
- name: Install GCC-11,G++-11, ccache
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update && sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V}
sudo apt-get update && sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V} ccache
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 111
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} 111
if: ${{matrix.os != 'windows-latest'}}
Expand All @@ -53,12 +59,8 @@ jobs:
- name: Use cmake
run: cmake --version

- name: prepare folder
run: cmake -E make_directory ./CMAKE_DEBUG_PATH

- name: cmake prepare for compile
working-directory: ./CMAKE_DEBUG_PATH
run: cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DMULTIPLY_TIMES=1
run: cmake -S . -B ./CMAKE_DEBUG_PATH -DCMAKE_BUILD_TYPE=DEBUG -DMULTIPLY_TIMES=1

- name: cmake compile lab_00
working-directory: ./CMAKE_DEBUG_PATH/lab_00
Expand Down Expand Up @@ -92,6 +94,11 @@ jobs:
run: tree
if: ${{matrix.os != 'windows-latest'}}

- name: cache configs output
run: |
ccache -p
ccache -s
# This workflow contains a single job called "build"
build:
name: test for the release script
Expand All @@ -100,7 +107,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-18.04, ubuntu-latest, windows-latest ]
os: [ ubuntu-18.04, ubuntu-latest ]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-18.04, ubuntu-latest, windows-latest ]
os: [ ubuntu-18.04, ubuntu-latest]
gcc_v: [ 11 ] # Version of G++,GCC
env:
GCC_V: ${{ matrix.gcc_v }}
Expand All @@ -29,30 +29,23 @@ jobs:

- name: hardwares - cpu
run: nproc; cat /proc/cpuinfo
if: ${{matrix.os != 'windows-latest'}}

- name: Install GCC-11,G++-11
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update && sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 111
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} 111
if: ${{matrix.os != 'windows-latest'}}
- name: prepare libopencv
- name: prepare libopencv ccache
run: |
sudo apt-get update && sudo apt-get install libopencv-dev
if: ${{matrix.os != 'windows-latest'}}
sudo apt-get install libopencv-dev ccache
- name: Use cmake
run: cmake --version

- name: prepare folder
run: cmake -E make_directory ./CMAKE_DEBUG_PATH

- name: cmake prepare for compile
working-directory: ./CMAKE_DEBUG_PATH
run: cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DMULTIPLY_TIMES=1
run: cmake -S . -B ./CMAKE_DEBUG_PATH -DCMAKE_BUILD_TYPE=DEBUG -DMULTIPLY_TIMES=1

- name: cmake compile lab_00
working-directory: ./CMAKE_DEBUG_PATH/lab_00
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16.6)

set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 7)
set(PROJECT_VERSION_MINOR 8)
set(PROJECT_VERSION_PATCH 1)
project(CS203_DSAA_template
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
Expand All @@ -11,7 +11,6 @@ project(CS203_DSAA_template

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_VERBOSE_MAKEFILE ON)
option(MULTIPLY_TIMES "This is a option for pre compile headers" ON) # 加速效果大约有1/3, 3s -> 2s左右

string(TIMESTAMP time_str "%Y/%m/%d %H:%M:%S")
MESSAGE(STATUS "Compiler In \n ${time_str}")
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<p align="center">
An awesome Algorithm Template for IO-Driven Single-File Problem(like Online-Judge Problem) ! </br>
分布式<sup title="由git保证">1</sup> 去中心化<sup title="推荐使用template生成仓库,不设置主库;没有易受打击的web页">2</sup> 跨平台<sup title="原生实现对拍功能">3</sup>的IO驱动型单文件问题<sup title="包括但不限于OJ平台题目">4</sup>解题模板
分布式<sup title="由git保证">1</sup> 去中心化<sup title="推荐使用template生成仓库,不设置主库;没有易受打击的web页">2</sup> 的IO驱动型单文件问题<sup title="包括但不限于OJ平台题目">4</sup>解题模板
<br />
<a href="https://github.com/Certseeds/CS203_DSAA_template/blob/dev/README.md"><strong>Explore the docs »</strong></a>
<br />
Expand Down Expand Up @@ -86,15 +86,17 @@ This is an example of how to list things you need to use the software and how to

#### Windows

1. Visual-Studio,与C++开发组件
2. WSL(推荐),`sudo apt install build-essential`
1. WSL(推荐),`sudo apt install build-essential ccache`

+ 命令行检测gcc版本

``` bash
# username @ ${pcName} in ${path}
gcc --version
# username @ ${pcName} in ${path}
g++ --version
# username @ ${pcName} in ${path}
ccache --version
```

### Installation
Expand Down Expand Up @@ -299,14 +301,14 @@ static const auto faster_streams = [] {
+ [x] AVL-Tree
+ [x] Matrix
+ [ ] AND MORE...
+ [x] 跨平台
+ [x] Windows(some TestCase fails because of `\n`)
+ [ ] 跨平台
+ [ ] Windows(No Support becuase ccache do not support MSVC, compile cost too much time and product size)
+ [x] Unix-Like
+ [x] CI-CD
+ [x] CI: GitHub-Actions提交触发
+ [x] CD: Tag触发的自动Release
+ [x] leetcode题目
+ [x] 预编译头文件加速编译速度
+ [x] ~~预编译头文件~~ccache加速编译
+ [x] basic文件夹添加CS205内容,方便入门C++
+ [x] 以及一部分rust代码
+ [ ] Cyaron测试数据生成
Expand Down
3 changes: 0 additions & 3 deletions algorithm/2021F/lab_02/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ foreach (elementName IN LISTS dependencies)
add_executable(${PROJECT_NAME}_${elementName}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${elementName}_test.cpp)
target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_TEST_MACRO)
target_link_libraries(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_template_INCLUDE)
target_precompile_headers(${PROJECT_NAME}_${elementName}_test REUSE_FROM
CS203_DSAA_template_INCLUDE_PCH17
)
MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${elementName}.cpp")
add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test)
set(CMAKE_CXX_STANDARD 11)
Expand Down
3 changes: 0 additions & 3 deletions algorithm/2021F/lab_03/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ foreach (elementName IN LISTS dependencies)
target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_TEST_MACRO)
target_link_libraries(${PROJECT_NAME}_${elementName}_test PRIVATE
CS203_DSAA_template_INCLUDE)
target_precompile_headers(${PROJECT_NAME}_${elementName}_test REUSE_FROM
CS203_DSAA_template_INCLUDE_PCH17
)
MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${elementName}.cpp")
add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test)
set(CMAKE_CXX_STANDARD 11)
Expand Down
3 changes: 0 additions & 3 deletions algorithm/2021F/lab_04/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ foreach (elementName IN LISTS dependencies)
target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_TEST_MACRO)
target_link_libraries(${PROJECT_NAME}_${elementName}_test PRIVATE
CS203_DSAA_template_INCLUDE)
target_precompile_headers(${PROJECT_NAME}_${elementName}_test REUSE_FROM
CS203_DSAA_template_INCLUDE_PCH17
)
MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${elementName}.cpp")
add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test)
set(CMAKE_CXX_STANDARD 11)
Expand Down
3 changes: 0 additions & 3 deletions algorithm/2021F/lab_05/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ foreach (elementName IN LISTS dependencies)
target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_TEST_MACRO)
target_link_libraries(${PROJECT_NAME}_${elementName} PRIVATE)
target_link_libraries(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_template_INCLUDE)
target_precompile_headers(${PROJECT_NAME}_${elementName}_test REUSE_FROM
CS203_DSAA_template_INCLUDE_PCH17
)
MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${elementName}.cpp")
add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test)
set(CMAKE_CXX_STANDARD 11)
Expand Down
3 changes: 0 additions & 3 deletions algorithm/2021F/lab_welcome/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ foreach (elementName IN LISTS dependencies)
add_executable(${PROJECT_NAME}_${elementName}_test ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${elementName}_test.cpp)
target_compile_definitions(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_TEST_MACRO)
target_link_libraries(${PROJECT_NAME}_${elementName}_test PRIVATE CS203_DSAA_template_INCLUDE)
target_precompile_headers(${PROJECT_NAME}_${elementName}_test REUSE_FROM
CS203_DSAA_template_INCLUDE_PCH17
)
MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_ORDER}_${elementName}.cpp")
add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName}_test)
set(CMAKE_CXX_STANDARD 11)
Expand Down
7 changes: 3 additions & 4 deletions algorithm/array/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ list(APPEND leetcode_order 485 500 532 561 566)
list(APPEND leetcode_order 581 605 661 73 665)
list(APPEND leetcode_order 674 697 so_03 1020 717)
list(APPEND leetcode_order 724 240 so_21 so_45 so_61)
list(APPEND leetcode_order 747 766)
list(APPEND leetcode_order 747 766 1606 48 59)
list(APPEND leetcode_order 334 238 560 804 806)
list(APPEND leetcode_order 807 811)
LIST(TRANSFORM leetcode_order PREPEND leetcode_)

set(dependencies ${dependencies} ${leetcode_order})
Expand All @@ -26,9 +28,6 @@ foreach (elementName IN LISTS dependencies)
add_executable(${PROJECT_NAME}_${elementName} ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp)
target_compile_definitions(${PROJECT_NAME}_${elementName} PRIVATE CS203_DSAA_TEST_MACRO)
target_link_libraries(${PROJECT_NAME}_${elementName} CS203_DSAA_template_INCLUDE)
target_precompile_headers(${PROJECT_NAME}_${elementName} REUSE_FROM
CS203_DSAA_template_INCLUDE_PCH17
)
MESSAGE(STATUS "${PROJECT_NAME}_${elementName} from ${CMAKE_CURRENT_SOURCE_DIR}/${elementName}.cpp")
add_test(${PROJECT_NAME}_${elementName}_CTEST ${PROJECT_NAME}_${elementName})
endforeach ()
Expand Down
Loading

0 comments on commit 1ebae62

Please sign in to comment.