Update cmake-single-platform.yml #4
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
name: CMake with GCC on Windows | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
# 检出代码 | |
- uses: actions/checkout@v4 | |
# 安装 MinGW(g++) | |
- name: Install MinGW | |
run: | | |
choco install mingw | |
# 配置 CMake 使用 g++ 编译器 | |
- name: Configure CMake with g++ | |
run: | | |
# 配置 CMake 使用 MinGW 编译器 | |
set CC=gcc | |
set CXX=g++ | |
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=C:/tools/mingw/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/tools/mingw/bin/g++.exe | |
# 编译项目 | |
- name: Build with CMake | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
# 运行测试 | |
- name: Run tests | |
run: ./build/tests --gtest_color=auto |