add script file #12
Workflow file for this run
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
# 这个工作流程是为了在 Ubuntu 平台上运行 CMake 项目。 | |
name: CMake on Ubuntu | |
on: | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest # 指定运行平台为 Ubuntu 的最新版本 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: '6.6.0' | |
modules: 'qthttpserver qtwebsockets' | |
- name: Configure CMake | |
# 配置 CMake 在 'build' 子目录中。CMAKE_BUILD_TYPE 只在使用单配置生成器(如 make)时需要。 | |
run: | | |
cmake -B ${{ github.workspace }}/build \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-S ${{ github.workspace }} | |
- name: Build | |
# 使用给定配置构建程序。 | |
run: cmake --build ${{ github.workspace }}/build | |
# 新增测试步骤 | |
- name: Run Tests | |
run: ctest --verbose --test-dir ${{ github.workspace }}/build/src/test | |