Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
22a19da
fix: remove incorrect 'cd keyring-cli' commands in CI workflow
alphaqiu Jan 26, 2026
611211e
security: prevent cleartext password logging in terminal
alphaqiu Jan 26, 2026
2c7c8b9
fix: resolve pre-existing compilation errors
alphaqiu Jan 26, 2026
f754708
fix: resolve test failures and compilation errors
alphaqiu Jan 26, 2026
a58c1e6
fix: platform-specific compilation errors
alphaqiu Jan 26, 2026
0c2d4d4
chore: upgrade rusqlite, rand, thiserror, dirs
alphaqiu Jan 26, 2026
702ae0a
test: fix test failures and improve coverage
p1024k Jan 27, 2026
626dd1e
feat: implement M1 v0.1 security and TUI features
alphaqiu Jan 27, 2026
dbd9e75
fix: address code review security issues
alphaqiu Jan 27, 2026
020bec4
ci: add test coverage and security verification workflows
alphaqiu Jan 27, 2026
91cb1fa
refactor: reorganize CI/CD workflows to eliminate functional overlap
alphaqiu Jan 27, 2026
75dc37f
fix: resolve all CI/CD workflow failures
alphaqiu Jan 27, 2026
f2b1ae7
fix: resolve CI/CD failures (clippy warnings and OpenSSL cross-compil…
alphaqiu Jan 27, 2026
746c547
fix: resolve all clippy errors blocking CI
alphaqiu Jan 27, 2026
dd08f99
style: fix code formatting issues
alphaqiu Jan 27, 2026
f10a3a7
fix: update Windows file lock API usage
alphaqiu Jan 27, 2026
aba02c4
test: ignore intermittent macOS CI test failure
alphaqiu Jan 27, 2026
eb370b6
Restore deleted CLI features (TDD approach)
p1024k Jan 28, 2026
944a454
feat(tui): implement delete command with confirmation
p1024k Jan 28, 2026
e5c3ba9
feat(tui): implement update command with field editing
p1024k Jan 28, 2026
e07c479
feat(tui): implement new command with password generation
p1024k Jan 28, 2026
168c92d
feat(tui): implement search command with fuzzy matching
p1024k Jan 28, 2026
579a3a8
feat(tui): wire up all command handlers in app
p1024k Jan 28, 2026
58d0704
fix: restore config key validation and add TUI /config command
p1024k Jan 28, 2026
aa2e805
feat(tui): implement keybindings module (TDD)
alphaqiu Jan 28, 2026
5ae3b50
feat(tui): integrate keyboard shortcuts and add statusline (TDD)
alphaqiu Jan 28, 2026
e9e87d2
docs(keybindings): add comprehensive tests and documentation
alphaqiu Jan 28, 2026
22ae23d
fix: Resolve GitHub Actions test failures
alphaqiu Jan 28, 2026
796ea60
fix(ci): Update GitHub Actions workflows for Windows 11 and fix shell…
alphaqiu Jan 28, 2026
40e7c1f
style: Format code and add CLAUDE.md memory files
alphaqiu Jan 28, 2026
6bebaba
feat(cli): unify command naming and add TUI health command
p1024k Jan 29, 2026
5c0ec00
feat(crypto): add BIP39 Passkey module for root key
p1024k Jan 29, 2026
aab276f
feat(crypto): add HKDF device key derivation module
p1024k Jan 29, 2026
d95488f
feat(crypto): update CryptoManager for Passkey root key architecture
p1024k Jan 29, 2026
4a582ed
fix(crypto): correct spec compliance for Passkey initialization
p1024k Jan 29, 2026
67239a8
test(crypto): fix test isolation by adding cleanup before each test
p1024k Jan 29, 2026
beca477
refactor(crypto): improve code quality for Passkey initialization
p1024k Jan 29, 2026
af6f241
feat(cloud): add OpenDAL-based cloud storage abstraction
p1024k Jan 29, 2026
1b93bb9
chore: add memory file
alphaqiu Jan 29, 2026
0029a6a
feat(sync): add file system watcher for TUI auto-sync
alphaqiu Jan 29, 2026
b629141
feat(cli): add sync commands with provider configuration
alphaqiu Jan 29, 2026
ffab56c
feat(config): add sync configuration file management
alphaqiu Jan 29, 2026
c21d773
test(security): add security audit tests for sync
alphaqiu Jan 29, 2026
4a26be1
test(integration): add full sync flow integration test
alphaqiu Jan 29, 2026
dfd12e4
refactor(cloud): derive Default for CloudProvider
alphaqiu Jan 29, 2026
dd5e362
test(watcher): fix flaky file system watcher tests
alphaqiu Jan 29, 2026
d5f2441
feat(cli): complete main.rs sync integration with --config, --provide…
alphaqiu Jan 29, 2026
e958103
feat(tui): add sync-related keyboard shortcuts
alphaqiu Jan 29, 2026
509eb91
feat(tui): implement global keyboard event handler
alphaqiu Jan 29, 2026
172b53e
feat(tui): implement cloud provider selection screen
alphaqiu Jan 29, 2026
becb530
feat(tui): implement provider configuration form
alphaqiu Jan 29, 2026
f32362f
feat(tui): implement settings screen layout
alphaqiu Jan 29, 2026
7d15e14
feat(tui): implement help screen with scrollable shortcuts
alphaqiu Jan 29, 2026
9339fdf
Implement ok recover CLI command
alphaqiu Jan 29, 2026
9d76239
Enhance ok devices CLI command with emoji display and warnings
alphaqiu Jan 29, 2026
01594d1
Implement ok config change-password command
alphaqiu Jan 29, 2026
cfef24a
feat(sync): Add nonce verification for tampering detection
alphaqiu Jan 29, 2026
b63becc
feat(tui): Integrate screens into main TUI application
alphaqiu Jan 29, 2026
1b56d53
test(sync): Add end-to-end sync flow integration tests
alphaqiu Jan 29, 2026
8f843a2
feat(cloud): add cloud metadata serialization structures
p1024k Jan 30, 2026
91a6793
feat(cloud): add OpenDAL-based cloud storage operations
p1024k Jan 30, 2026
e682e0c
feat(sync): add CloudSyncService with CloudStorage integration
p1024k Jan 30, 2026
c541beb
feat(crypto): complete KeyHierarchy save/unlock with key wrapping
p1024k Jan 30, 2026
8014f52
feat(tui): implement action handlers for settings, sync, config
p1024k Jan 30, 2026
421c41f
feat(tui): implement command autocomplete
p1024k Jan 30, 2026
c332bf6
test(sync): add nonce conflict prompt tests
p1024k Jan 30, 2026
8930f0c
feat(cli): implement mnemonic database save
p1024k Jan 30, 2026
91246ea
chore: fix clippy warnings and clean up unused code
p1024k Jan 30, 2026
ea6e304
feat(cloud): add TencentCOS, HuaweiOBS, UpYun providers
p1024k Jan 30, 2026
acc2947
feat(cloud): implement Dropbox, Google Drive, and OneDrive operators
p1024k Jan 30, 2026
aebc4ed
feat(cloud): implement AliyunDrive, AliyunOSS, Tencent COS, Huawei OB…
p1024k Jan 30, 2026
5cef74f
feat(tui): add configuration fields for all 11 cloud providers
p1024k Jan 30, 2026
e2c596e
feat(tui): implement config-to-CloudConfig conversion
p1024k Jan 30, 2026
b8651f8
feat(cloud): add connection testing functionality
p1024k Jan 30, 2026
57df5a2
feat: add version field to StoredRecord and SyncRecord for conflict d…
p1024k Jan 30, 2026
c81d512
feat: implement version-based conflict detection
p1024k Jan 30, 2026
e2d03f2
feat: create conflict resolution screen for TUI
p1024k Jan 30, 2026
8b02b2e
feat: add conflict detection method to SyncService
p1024k Jan 30, 2026
e5673e3
fix: add version field to test StoredRecord and SyncRecord constructions
p1024k Jan 30, 2026
15655a8
Implement M2 onboarding wizard with Passkey generation/import and mas…
p1024k Jan 30, 2026
750363d
Fix wizard command to handle EOF gracefully
p1024k Jan 30, 2026
41e918e
feat(security): integrate SensitiveString for zeroization across cryp…
p1024k Jan 30, 2026
5ab5122
fix(tests): fix SFTP field count and add tests for all 11 providers
p1024k Jan 30, 2026
86526e3
feat(tui): add validate() method and CloudConfig conversion tests
p1024k Jan 30, 2026
4e5c1f6
feat(tui/cloud): add connection testing functionality
p1024k Jan 30, 2026
fabdbe8
feat(tui): add sync screen with status display
p1024k Jan 30, 2026
121f8ce
feat(tui): integrate sync screen with app
p1024k Jan 30, 2026
6bc8737
feat(tui): make settings screen data-driven
p1024k Jan 30, 2026
a2dda6e
feat(tui): show autocomplete matches
p1024k Jan 30, 2026
ecfea73
feat(tui): add stub for record name autocomplete
p1024k Jan 30, 2026
9fbb742
chore: 添加测试用例
p1024k Jan 30, 2026
efdd0dc
test: add concurrent access tests for SQLite WAL mode
alphaqiu Jan 30, 2026
99cc15f
feat: add MCP configuration module
alphaqiu Jan 30, 2026
c8da603
feat: add platform detection and memory protection
alphaqiu Jan 30, 2026
d4b07d8
feat: add file locking for MCP single instance
alphaqiu Jan 30, 2026
0a1bdfc
feat: add used token cache for replay protection
alphaqiu Jan 30, 2026
19ca036
feat: add HMAC-SHA256 confirmation tokens for MCP authorization
alphaqiu Jan 30, 2026
b22ca2a
feat: add tag-based policy engine for MCP authorization
alphaqiu Jan 30, 2026
6240ded
feat: add session cache for MCP authorization
alphaqiu Jan 30, 2026
babbc79
feat: add SSH tool handler with authorization checks
alphaqiu Jan 30, 2026
1697322
feat: add SSH executor with openssh crate
alphaqiu Jan 30, 2026
b1f1965
feat: add API tool definitions (6 tools with JSON Schema)
alphaqiu Jan 30, 2026
04ccc0c
feat: add Git executor with git2 crate
alphaqiu Jan 30, 2026
6226521
fix: add SSH executor implementation (separate from tool definitions)
alphaqiu Jan 30, 2026
2fcbecb
feat: add SSH tool input/output definitions for MCP
alphaqiu Jan 30, 2026
96f6316
feat: add audit logging with JSON Lines and rotation
alphaqiu Jan 30, 2026
d83852d
feat: add tag configuration with env/risk enums
alphaqiu Jan 30, 2026
7d794b5
feat: add CLI MCP commands (start/stop/status/logs)
alphaqiu Jan 30, 2026
71660e2
feat: integrate MCP commands into CLI main entry point
alphaqiu Jan 30, 2026
6dfed1c
feat: add policy preview dialog for tag configuration
alphaqiu Jan 30, 2026
2d0e632
feat: add MCP server with rmcp stdio transport
alphaqiu Jan 30, 2026
cda7d4e
feat: add TUI tag selection widget with ratatui
alphaqiu Jan 30, 2026
db73d6b
fix: correct async calls, remove Arc wrappers, fix test setup
alphaqiu Jan 31, 2026
70496d9
feat: implement McpKeyCache with master password decryption
alphaqiu Jan 31, 2026
58fbb3b
feat: add cross-platform memory protection to SSH executor
alphaqiu Jan 31, 2026
3acd7b9
feat: add memory protection to Git executor SSH keys
alphaqiu Jan 31, 2026
08de06e
refactor: rename auth module to policy for clarity
alphaqiu Jan 31, 2026
632a25d
refactor: move audit module into mcp directory
alphaqiu Jan 31, 2026
bb21e31
refactor: unify file lock path format
alphaqiu Jan 31, 2026
7508d41
fix: resolve compilation warnings and add integration tests
alphaqiu Jan 31, 2026
3a7349d
fix: secure SSH known_hosts verification
alphaqiu Feb 1, 2026
879cd42
feat: add cross compilation support for Linux and Windows
alphaqiu Feb 1, 2026
3b27d4e
fix: update cross compilation to Linux targets only
alphaqiu Feb 1, 2026
a11a984
Merge feature/cross-compilation into develop
alphaqiu Feb 1, 2026
ccaba50
feat(reqwest): replace native-tls-vendored with rustls-tls
alphaqiu Feb 1, 2026
5ce9412
chore: update Cargo.lock for rustls reqwest
alphaqiu Feb 1, 2026
7b62523
refactor(ssh): remove openssh dependency
alphaqiu Feb 1, 2026
042972f
refactor(ssh): rewrite executor using system ssh calls
alphaqiu Feb 1, 2026
e2fb8f4
chore: update Cargo.lock after removing openssh dependency
alphaqiu Feb 1, 2026
c8138ea
feat: replace git2 with gix for pure Rust Git implementation
alphaqiu Feb 1, 2026
dc15076
fix: address Phase 3 spec compliance review findings
alphaqiu Feb 1, 2026
3d715c7
test: verify cross-compilation to all target platforms
alphaqiu Feb 1, 2026
21c0d94
docs: add rust-only cross-compilation implementation plan
alphaqiu Feb 1, 2026
54d43cf
docs: add comprehensive Phase 4 verification report
alphaqiu Feb 1, 2026
7e0bdb7
docs: update cross-compilation documentation for pure Rust
alphaqiu Feb 1, 2026
ec7cf35
docs: add Phase 5 completion report
alphaqiu Feb 1, 2026
c4dc5b4
feat: conditional opendal features for Windows cross-compilation
alphaqiu Feb 1, 2026
b3c0de0
fix: suppress dead_code warning for has_credentials method
alphaqiu Feb 1, 2026
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
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Cargo configuration for cross compilation aliases

[alias]
# Target platform aliases for cross compilation
linux-x64 = "build --target x86_64-unknown-linux-gnu"
linux-arm = "build --target aarch64-unknown-linux-gnu"
# windows-x64 = "build --target x86_64-pc-windows-msvc" # Use CI/CD for Windows builds

# Combined cross-compilation command (Linux only)
cross-all = ["build --target x86_64-unknown-linux-gnu",
"build --target aarch64-unknown-linux-gnu"]
11 changes: 11 additions & 0 deletions .github/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<claude-mem-context>
# Recent Activity

<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->

### Jan 29, 2026

| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #244 | 12:16 AM | 🔴 | Fixed multiple GitHub Actions test failures in keyring-cli | ~381 |
</claude-mem-context>
13 changes: 13 additions & 0 deletions .github/workflows/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<claude-mem-context>
# Recent Activity

<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->

### Jan 29, 2026

| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #260 | 12:35 AM | 🔴 | Fixed GitHub Actions Windows compatibility issues | ~281 |
| #251 | 12:19 AM | 🔴 | Fixed Test Coverage workflow missing dependencies | ~264 |
| #250 | " | 🔴 | Fixed Windows MSRV check shell conflict in security workflow | ~284 |
</claude-mem-context>
121 changes: 32 additions & 89 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,51 +31,50 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
key: build-${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
key: build-${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v4
with:
path: keyring-cli/target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
path: target
key: build-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build for x86_64
run: |
cd keyring-cli
cargo build --target x86_64-apple-darwin --release --verbose

- name: Build for aarch64
run: |
cd keyring-cli
cargo build --target aarch64-apple-darwin --release --verbose

- name: Create universal binary
run: |
mkdir -p target/universal-apple-darwin-release
lipo -create \
keyring-cli/target/x86_64-apple-darwin/release/ok \
keyring-cli/target/aarch64-apple-darwin/release/ok \
-output keyring-cli/target/universal-apple-darwin-release/ok
chmod +x keyring-cli/target/universal-apple-darwin-release/ok
target/x86_64-apple-darwin/release/ok \
target/aarch64-apple-darwin/release/ok \
-output target/universal-apple-darwin-release/ok
chmod +x target/universal-apple-darwin-release/ok

- name: Strip binary
run: strip -x keyring-cli/target/universal-apple-darwin-release/ok
run: strip -x target/universal-apple-darwin-release/ok

- name: Upload macOS universal binary
uses: actions/upload-artifact@v4
with:
name: ok-macos-universal
path: keyring-cli/target/universal-apple-darwin-release/ok
path: target/universal-apple-darwin-release/ok

- name: Create archive
if: startsWith(github.ref, 'refs/tags/v')
run: |
cd keyring-cli/target/universal-apple-darwin-release
cd target/universal-apple-darwin-release
tar czf ok-macos-universal.tar.gz ok
mv ok-macos-universal.tar.gz ../../../

Expand All @@ -98,38 +97,32 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
keyring-cli/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
target
key: build-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: |
cd keyring-cli
cargo build --release --verbose

- name: Strip binary
run: strip keyring-cli/target/release/ok
run: strip target/release/ok

- name: Upload Linux binary
uses: actions/upload-artifact@v4
with:
name: ok-linux-x86_64
path: keyring-cli/target/release/ok
path: target/release/ok

- name: Create archive
if: startsWith(github.ref, 'refs/tags/v')
run: |
cd keyring-cli/target/release
cd target/release
tar czf ok-linux-x86_64.tar.gz ok
mv ok-linux-x86_64.tar.gz ../../../

Expand Down Expand Up @@ -165,29 +158,28 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
keyring-cli/target
key: ${{ runner.os }}-cargo-arm64-${{ hashFiles('**/Cargo.lock') }}
target
key: build-${{ runner.os }}-cargo-arm64-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: |
cd keyring-cli
CC=aarch64-linux-gnu-gcc \
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
cargo build --target aarch64-unknown-linux-gnu --release --verbose

- name: Strip binary
run: aarch64-linux-gnu-strip keyring-cli/target/aarch64-unknown-linux-gnu/release/ok
run: aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/ok

- name: Upload Linux ARM64 binary
uses: actions/upload-artifact@v4
with:
name: ok-linux-aarch64
path: keyring-cli/target/aarch64-unknown-linux-gnu/release/ok
path: target/aarch64-unknown-linux-gnu/release/ok

- name: Create archive
if: startsWith(github.ref, 'refs/tags/v')
run: |
cd keyring-cli/target/aarch64-unknown-linux-gnu/release
cd target/aarch64-unknown-linux-gnu/release
tar czf ok-linux-aarch64.tar.gz ok
mv ok-linux-aarch64.tar.gz ../../../

Expand All @@ -201,7 +193,7 @@ jobs:
# Build for Windows
build-windows:
name: Build Windows (x86_64)
runs-on: windows-latest
runs-on: windows-2022

defaults:
run:
Expand All @@ -220,24 +212,23 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
keyring-cli/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
target
key: build-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: |
cd keyring-cli
cargo build --release --verbose

- name: Upload Windows binary
uses: actions/upload-artifact@v4
with:
name: ok-windows-x86_64
path: keyring-cli/target/release/ok.exe
path: target/release/ok.exe

- name: Create archive
if: startsWith(github.ref, 'refs/tags/v')
run: |
Compress-Archive -Path keyring-cli\target\release\ok.exe -DestinationPath ok-windows-x86_64.zip
Compress-Archive -Path target\release\ok.exe -DestinationPath ok-windows-x86_64.zip

- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -249,7 +240,7 @@ jobs:
# Build for Windows ARM64
build-windows-arm64:
name: Build Windows (ARM64)
runs-on: windows-latest
runs-on: windows-2022

defaults:
run:
Expand All @@ -270,24 +261,23 @@ jobs:
path: |
~/.cargo/registry
~/.cargo/git
keyring-cli/target
key: ${{ runner.os }}-cargo-arm64-${{ hashFiles('**/Cargo.lock') }}
target
key: build-${{ runner.os }}-cargo-arm64-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: |
cd keyring-cli
cargo build --target aarch64-pc-windows-msvc --release --verbose

- name: Upload Windows ARM64 binary
uses: actions/upload-artifact@v4
with:
name: ok-windows-aarch64
path: keyring-cli/target/aarch64-pc-windows-msvc/release/ok.exe
path: target/aarch64-pc-windows-msvc/release/ok.exe

- name: Create archive
if: startsWith(github.ref, 'refs/tags/v')
run: |
Compress-Archive -Path keyring-cli\target\aarch64-pc-windows-msvc\release\ok.exe -DestinationPath ok-windows-aarch64.zip
Compress-Archive -Path target\aarch64-pc-windows-msvc\release\ok.exe -DestinationPath ok-windows-aarch64.zip

- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -296,50 +286,3 @@ jobs:
files: ok-windows-aarch64.zip
generate_release_notes: true

# Run tests
test:
name: Run Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev

- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
keyring-cli/target
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}

- name: Run tests
run: |
cd keyring-cli
cargo test --verbose --all-features

- name: Run clippy
run: |
cd keyring-cli
cargo clippy -- -D warnings

- name: Check formatting
run: |
cd keyring-cli
cargo fmt -- --check
61 changes: 61 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Test Coverage

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y bc jq

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: coverage-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run tests with coverage
run: |
cargo install cargo-tarpaulin
cargo tarpaulin --features test-env --out Html --out Json --output-dir coverage --timeout 300 --verbose

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/

- name: Check coverage threshold
run: |
COVERAGE=$(jq '.coverage // 0' coverage/tarpaulin.json 2>/dev/null || echo "0")
echo "Coverage: $COVERAGE%"
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
echo "❌ Coverage below 80% (current: $COVERAGE%)"
exit 1
else
echo "✅ Coverage at $COVERAGE%"
fi

- name: Add coverage summary
run: |
COVERAGE=$(jq '.coverage // 0' coverage/tarpaulin.json 2>/dev/null || echo "0")
echo "## Test Coverage" >> $GITHUB_STEP_SUMMARY
echo "Current coverage: **$COVERAGE%**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Target: 80%+ for M1 v0.1 release" >> $GITHUB_STEP_SUMMARY
Loading
Loading