Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
TARPAULIN_VERSION: 0.35.1

jobs:
linter:
runs-on: ubuntu-latest
name: Cargo fmt and clippy

steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --all -- --check

tests:
runs-on: ubuntu-latest
name: Cargo test and tarpaulin
needs: linter

steps:
- uses: actions/checkout@v4

- name: Install cargo-tarpaulin@${{ env.TARPAULIN_VERSION }}
run: cargo install cargo-tarpaulin@${{ env.TARPAULIN_VERSION }} --locked

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

- name: Run coverage
run: cargo tarpaulin --verbose
2 changes: 1 addition & 1 deletion tests/cli_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn test_version_output() {
let stdout = String::from_utf8_lossy(&output.stdout);
let lower = stdout.to_lowercase();
assert!(lower.contains("clawshell"));
assert!(stdout.contains("v0.1.0"));
assert!(stdout.contains("v0.0.1"));
assert!(lower.contains("openclaw"));
}

Expand Down