From 737c8e17dd0f47edffdcaca9be9951526d358b72 Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Wed, 4 Feb 2026 22:59:05 +0800 Subject: [PATCH] Add Gitea CTest workflow configuration --- .gitea/workflows/test.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .gitea/workflows/test.yaml diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml new file mode 100644 index 0000000..d5e1e3c --- /dev/null +++ b/.gitea/workflows/test.yaml @@ -0,0 +1,33 @@ +name: Gitea CTest Workflow + +on: + push: + branches: [ "main", "master" ] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + # 显式使用 gitea.com 上的 checkout 镜像 + - name: Checkout Code + uses: https://gitea.com/actions/checkout@v4 + with: + # 对于镜像仓库,建议显式指定 fetch-depth 确保获取完整历史(如果需要) + fetch-depth: 1 + + - 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) \ No newline at end of file