diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..534f6cf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + ci: + name: test / fmt / clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Cache cargo build artifacts + uses: Swatinem/rust-cache@v2 + + - name: Check formatting + run: cargo fmt --check + + - name: Run clippy + run: cargo clippy --all-targets -- -D warnings + + - name: Run tests + run: cargo test diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e2c8829 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 argszero + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/main.rs b/src/main.rs index 0fb851a..7b8ff13 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,12 +7,11 @@ /// 返回项目横幅文本(便于测试与展示) pub fn banner() -> String { - format!( - "AITokenPool — AI Token 共享池\n\ - 企业版:key 池 + 员工点数配额 · 公共版:共享市场\n\ - 架构:中心化(方案 A),Rust + axum\n\ - 状态:项目初始化中(2026-08-13)" - ) + "AITokenPool — AI Token 共享池\n\ + 企业版:key 池 + 员工点数配额 · 公共版:共享市场\n\ + 架构:中心化(方案 A),Rust + axum\n\ + 状态:项目初始化中(2026-08-13)" + .to_string() } fn main() {