-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[重构项目结构和工作流]: 对项目文件结构和GitHub Actions工作流进行了一系列的重构和改进。
- 更新了`build.yml`工作流,移除了对特定文件变更的忽略,统一了构建类型为`RelWithDebInfo`,并且引入了新的`install-vcpkg`动作,更新了vcpkg的缓存策略。 - 删除了`clean_cache.yml`工作流中的定时触发,仅保留手动触发。 - 在`delete_workflow.yml`中更新了删除运行的结论模式。 - 更新了`readme.yml`工作流,去除了Node.js的版本设置。 - 删除了`toolchain.yml`文件,因为它的功能可能已经合并到其他工作流中。 - 删除了`AtomicQueue`目录及其相关文件,因为该功能可能已经过时或不再需要。 - 更新了`Breakpad`目录中的文件,更改了可执行文件和链接库的名称。 - 添加了全新的`Crashpad`目录和相关文件,用于集成Crashpad错误报告功能。 - 更新了`CMakeLists.txt`文件,增加了新的子目录和依赖,并且提升了CMake的最低版本要求。 - 更新了`CountDownLatch`、`Curl`、`DesignPattern`、`Glog`、`Icmp`、`MonitorDir`、`Mutex`、`OpenSSL`、`Thread`等目录中的文件,主要是更改了头文件的包含路径。 - 添加了`build_info.cmake`、`common.cmake`和`vcpkg.cmake`文件,用于改进项目的构建系统。 - 添加了`setVsDev.ps1` PowerShell脚本,用于设置Visual Studio开发环境。 - 重命名了一些文件,将`object.hpp`和`scopeguard.hpp`移动到了`utils`目录下。 - 添加了`vcpkg.json`文件,用于管理项目的vcpkg依赖。
- Loading branch information
Showing
37 changed files
with
420 additions
and
421 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,23 +1,14 @@ | ||
name: CMake Build | ||
|
||
on: | ||
# push代码时触发workflow | ||
push: | ||
paths-ignore: # 下列文件的变更不触发部署,可以自行添加 | ||
- '.github/workflows/clean_cache.yml' | ||
- '.github/workflows/delete_workflow.yml' | ||
- '.github/workflows/readme.yml' | ||
- '.github/workflows/toolchain.yml' | ||
paths-ignore: | ||
- '.clang*' | ||
- '.gitignore' | ||
- 'LICENSE' | ||
- 'README*' | ||
pull_request: | ||
paths-ignore: # 下列文件的变更不触发部署,可以自行添加 | ||
- '.github/workflows/clean_cache.yml' | ||
- '.github/workflows/delete_workflow.yml' | ||
- '.github/workflows/readme.yml' | ||
- '.github/workflows/toolchain.yml' | ||
paths-ignore: | ||
- '.clang*' | ||
- '.gitignore' | ||
- 'LICENSE' | ||
|
@@ -35,74 +26,73 @@ jobs: | |
- macos-latest | ||
- ubuntu-latest | ||
build_type: | ||
- "Release" | ||
- "RelWithDebInfo" | ||
generators: | ||
- "Ninja" | ||
vcpkg_libs: | ||
- glog breakpad benchmark gtest openssl[tools] curl[openssl,brotli,c-ares,http2,tool] | ||
|
||
steps: | ||
- name: Restore windows vcpkg | ||
if: startsWith(matrix.os, 'windows') | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: C:\vcpkg\installed | ||
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }} | ||
- name: Restore macos or ubuntu vcpkg | ||
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: /usr/local/share/vcpkg/installed | ||
key: ${{ runner.os }}-vcpkg-installed-${{ matrix.os }} | ||
|
||
- name: Install dependencies on windows | ||
if: startsWith(matrix.os, 'windows') | ||
run: | | ||
choco install ninja | ||
ninja --version | ||
cmake --version | ||
vcpkg install ${{ matrix.vcpkg_libs }} --triplet x64-windows | ||
- name: Install dependencies on macos | ||
if: startsWith(matrix.os, 'macos') | ||
shell: bash | ||
run: | | ||
brew install ninja | ||
brew install ninja python-setuptools | ||
ninja --version | ||
cmake --version | ||
clang --version | ||
vcpkg install ${{ matrix.vcpkg_libs }} --triplet x64-osx | ||
- name: Install dependencies on ubuntu | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install ninja-build | ||
sudo apt-get install ninja-build clang | ||
ninja --version | ||
cmake --version | ||
gcc --version | ||
vcpkg install ${{ matrix.vcpkg_libs }} --triplet x64-linux | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Enable Developer Command Prompt | ||
if: startsWith(matrix.os, 'windows') | ||
uses: ilammy/[email protected] | ||
- name: Install custom vcpkg | ||
uses: RealChuan/install-vcpkg@main | ||
with: | ||
arch: amd64 | ||
- name: Configure windows | ||
if: startsWith(matrix.os, 'windows') | ||
repo: 'https://github.com/RealChuan/vcpkg.git' | ||
branch: 'dev' | ||
|
||
- name: Update vcpkg manifest baseline | ||
shell: bash | ||
run: | | ||
cmake \ | ||
-S . \ | ||
-B ./build \ | ||
-DCMAKE_C_COMPILER=cl \ | ||
-DCMAKE_CXX_COMPILER=cl \ | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | ||
-G "${{ matrix.generators }}" \ | ||
-DCMAKE_INSTALL_PREFIX:PATH=instdir | ||
- name: Configure macos or ubuntu | ||
vcpkg x-update-baseline | ||
- name: Cache vcpkg | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ github.workspace }}/build/vcpkg_installed | ||
key: ${{ matrix.os }}-vcpkg-installed-${{ runner.os }}-${{ github.sha }} | ||
restore-keys: | | ||
${{ matrix.os }}-vcpkg-installed-${{ runner.os }}- | ||
${{ matrix.os }}-vcpkg-installed- | ||
${{ matrix.os }}- | ||
save-always: true | ||
|
||
- name: Configure and build windows | ||
if: startsWith(matrix.os, 'windows') | ||
shell: pwsh | ||
run: | | ||
.\scripts\windows\setVsDev.ps1 | ||
cmake ` | ||
-S . ` | ||
-B ./build ` | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ` | ||
-G "${{ matrix.generators }}" ` | ||
; if (-not $?) { Get-Content ./build/vcpkg_installed/vcpkg/issue_body.md; exit 1 } | ||
cmake --build ./build --config ${{ matrix.build_type }} | ||
- name: Configure and build macos or ubuntu | ||
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') | ||
shell: bash | ||
run: | | ||
|
@@ -111,10 +101,7 @@ jobs: | |
-B ./build \ | ||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | ||
-G "${{ matrix.generators }}" \ | ||
-DCMAKE_INSTALL_PREFIX:PATH=instdir | ||
- name: Build | ||
shell: bash | ||
run: | | ||
|| (cat ./build/vcpkg_installed/vcpkg/issue_body.md && exit 1) | ||
cmake --build ./build --config ${{ matrix.build_type }} | ||
- name: Test | ||
|
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,8 +1,5 @@ | ||
name: Cleanup caches by a branch | ||
on: | ||
# 每周一 0 点触发 | ||
schedule: | ||
- cron: '0 0 * * 1' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.