diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..434d21b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: Test Rust + +on: + push: + branches: [ "main", "develop" ] + pull_request: + branches: [ "main", "develop" ] + +permissions: + contents: read + +jobs: + test: + name: Test and Coverage + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v7 + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - name: Lint + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Generate coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: lcov.info + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true diff --git a/src/llm/ollama.rs b/src/llm/ollama.rs index 5c9778e..e7fbece 100644 --- a/src/llm/ollama.rs +++ b/src/llm/ollama.rs @@ -37,11 +37,14 @@ struct OllamaUsage { total_tokens: Option, } +// Scaffolding for a future "list models" command; only exercised by tests today. +#[allow(dead_code)] #[derive(Debug, Decode)] struct OllamaTagModel { name: String, } +#[allow(dead_code)] #[derive(Debug, Decode)] struct OllamaTagsResponse { models: Vec, @@ -173,6 +176,8 @@ impl OllamaClient { } } + /// Scaffolding for a future "list models" command; only exercised by tests today. + #[allow(dead_code)] fn tags_url(&self) -> String { format!("{}/api/tags", self.base_url) }