diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..2a4c6a6 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,57 @@ +name: Rust CI Pipeline +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test-and-build: + runs-on: ubuntu-latest + steps: + # 1. 检出代码 - 使用 Gitea 本地的 actions 镜像 + - name: 🔍 Check out repository code + uses: https://devstar.cn/actions/checkout@v4 + + # 2. 安装 Rust 工具链 + - name: 🦀 Set up Rust + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + # 3. 显示环境信息 + - name: ℹ️ Environment Info + run: | + rustc --version + cargo --version + echo "Building repository: ${{ gitea.repository }}" + + # 4. 构建项目(调试模式) + - name: 🔧 Build (Debug) + run: cargo build --verbose + + # 5. 构建项目(发布模式) + - name: 🚀 Build (Release) + run: cargo build --release --verbose + + # 6. 运行测试 + - name: ✅ Run Tests + run: cargo test --verbose + + # 7. 检查代码格式 + - name: 📏 Check Format + run: cargo fmt -- --check + + # 8. 运行 Clippy 静态分析 + - name: 🔍 Clippy Check + run: cargo clippy -- -D warnings + + # 9. 生成文档 + - name: 📚 Build Documentation + run: cargo doc --no-deps + + # 10. 清理构建缓存(可选) + - name: 🧹 Cleanup + run: cargo clean \ No newline at end of file diff --git a/.gitea/workflows/dependabot.yml b/.gitea/workflows/dependabot.yml deleted file mode 100644 index 1f79a6f..0000000 --- a/.gitea/workflows/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -# For more details, see https://containers.dev/guide/dependabot -version: 2 -updates: - - package-ecosystem: "devcontainers" - directory: "/" - schedule: - interval: weekly \ No newline at end of file