name: CI on: push: branches: [main, master, develop, 'v*', 'feature/*'] pull_request: branches: [main, master] jobs: build-and-test: name: Ubuntu 22.04 • GCC 11 • CMake runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: build_type: [Debug, Release] steps: - name: 检出代码 uses: actions/checkout@v4 with: submodules: recursive - name: 安装依赖 run: | sudo apt-get update sudo apt-get install -y \ g++-11 \ cmake \ ninja-build \ libeigen3-dev - name: 配置 CMake env: CC: gcc-11 CXX: g++-11 run: | cmake -B build \ -G Ninja \ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DBUILD_TESTS=ON \ -DBUILD_BENCHMARKS=OFF \ -DBUILD_EXAMPLES=OFF \ -DVDE_BUILD_PYTHON=OFF \ -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic" - name: 编译 run: cmake --build build --parallel $(nproc) - name: 运行测试 working-directory: build run: | ctest --output-on-failure \ --test-dir . \ -j $(nproc) \ --timeout 300 - name: 上传测试结果 if: always() uses: actions/upload-artifact@v4 with: name: test-results-${{ matrix.build_type }} path: | build/Testing/Temporary/LastTest.log build/Testing/**/*.xml