Merge pull request #47 from hunjixin/feat/add_init_from_env_and_more_… #146
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Basic | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Linelint | |
| uses: fernandrone/linelint@master | |
| id: linelint | |
| - name: Check signed commits in PR | |
| if: | | |
| github.event_name == 'pull_request' || | |
| github.event_name == 'pull_request_target' | |
| uses: 1Password/check-signed-commits-action@v1 | |
| - name: Install rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: clippy,rustfmt | |
| - name: Foramt check | |
| run: | | |
| cargo fmt --all -- --check | |
| - name: Run Clippy | |
| run: | | |
| cargo clippy -p deepseek-api --all-targets --all-features | |
| cargo clippy -p basic --all-targets --all-features | |
| cargo clippy -p chat-stream --all-targets --all-features | |
| cargo clippy -p fim --all-targets --all-features | |
| cargo clippy -p sync-basic --all-targets --all-features | |
| cargo clippy -p ds-cli --all-targets --all-features | |
| cargo clippy -p function-call --all-targets --all-features | |
| cargo clippy -p deep-think --all-targets --all-features | |
| - name: Build | |
| run: | | |
| cargo build -p deepseek-api --all-targets | |
| cargo build -p basic --all-targets | |
| cargo build -p chat-stream --all-targets | |
| cargo build -p fim --all-targets | |
| cargo build -p sync-basic --all-targets | |
| cargo build -p ds-cli --all-targets | |
| cargo build -p function-call --all-targets | |
| cargo build -p deep-think --all-targets | |
| - name: Run tests | |
| run: | | |
| cargo test -p deepseek-api --verbose | |
| cargo test -p deepseek-api --verbose --features=is_sync | |
| - name: Publish crates | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| echo "Publishing crates" | |
| cargo publish -p deepseek-api --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| cargo publish -p ds-cli --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |