Files
rust/.gitea/workflows/ci.yaml

41 lines
990 B
YAML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Rust CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-and-build:
runs-on: ubuntu-latest
container:
image: ghcr.io/rust-lang/rust:latest
steps:
# 1. 检出代码 - 使用 Gitea 本地的 actions 镜像
- name: 🔍 Check out repository code
uses: https://devstar.cn/actions/checkout@v4
# 2. 显示环境信息
- name: Environment Info
run: |
rustc --version
cargo --version
echo "Building repository: ${{ gitea.repository }}"
# 3. 构建项目(调试模式)
- name: 🔧 Build (Debug)
run: cargo build --verbose
# 4. 构建项目(发布模式)
- name: 🚀 Build (Release)
run: cargo build --release --verbose
# 5. 运行测试
- name: ✅ Run Tests
run: cargo test --verbose
# 6. 清理构建缓存
- name: 🧹 Cleanup
run: cargo clean