Files
leetcode/.gitea/workflows/test.yaml
Jeffrey Hsu 3559f83475
Some checks failed
Gitea CTest Workflow / test (push) Failing after 4s
Replace checkout action with direct git clone command in test.yaml
2026-02-04 23:57:04 +08:00

30 lines
809 B
YAML

name: Gitea CTest Workflow
on:
push:
branches: [ "main", "master" ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
run: |
git clone https://cantyonion.site/git/cantyonion/leetcode.git .
- name: Configure CMake
# -B build 创建构建目录,-S . 指定源代码在当前目录
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
- name: Build with CMake
# 使用 --parallel 充分利用 Runner 核心数
run: cmake --build build --parallel $(nproc)
- name: Run CTest via CMake
# 在 build 目录下运行 ctest
# --output-on-failure 可以在测试失败时直接看到 log
run: |
cd build
ctest --output-on-failure --parallel $(nproc)