Skip to content

Commit 967ba3d

Browse files
authored
Merge branch 'main' into techLink
2 parents 916cb4d + 8838747 commit 967ba3d

File tree

274 files changed

+19332
-56061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

274 files changed

+19332
-56061
lines changed

.cargo/config.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[target.wasm32-unknown-unknown]
2+
rustflags = [
3+
"-C", "panic=abort",
4+
"-C", "link-arg=--import-memory",
5+
"-C", "link-arg=--max-memory=4294967296",
6+
]

.github/workflows/advanced-testing.yml

Lines changed: 0 additions & 100 deletions
This file was deleted.

.github/workflows/benchmark.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,60 @@ jobs:
2020
- name: Cache cargo
2121
uses: Swatinem/rust-cache@v2
2222

23+
- name: Install coverage tools
24+
run: |
25+
cargo install cargo-llvm-cov
26+
cargo install cargo-tarpaulin
27+
2328
- name: Format
2429
run: cargo fmt --all -- --check
2530

2631
- name: Clippy
27-
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::needless_pass_by_value -A clippy::must_use_candidate -A clippy::missing_panics_doc -A clippy::missing_errors_doc -A clippy::doc_markdown -A clippy::panic_in_result_fn -A clippy::assertions_on_constants -A clippy::unreadable_literal -A clippy::ignore_without_reason -A clippy::too_many_lines -A clippy::trivially_copy_pass_by_ref -A clippy::needless_borrow -A clippy::unused_unit -A clippy::len_zero -A clippy::unnecessary_cast -A clippy::needless_late_init -A clippy::map_unwrap_or -A clippy::items_after_statements -A clippy::manual_assert -A clippy::unnecessary_wraps -A clippy::similar_names -A clippy::no_effect_underscore_binding -A clippy::bool_assert_comparison -A clippy::uninlined_format_args -A clippy::useless_vec -A dead_code -A unused_variables
28-
29-
- name: Test
30-
run: cargo test --lib
32+
run: cargo clippy --workspace --all-features -- -D warnings
3133

3234
- name: Build WASM (release)
3335
run: cargo build --target wasm32-unknown-unknown --release
3436

35-
- name: Docs
36-
run: cargo doc --no-deps --document-private-items
37+
- name: Run tests with coverage
38+
run: |
39+
cargo llvm-cov --workspace --lib --bins --tests --all-features --lcov --output-path lcov.info
40+
cargo llvm-cov --workspace --lib --bins --tests --all-features --html
41+
42+
- name: Check coverage thresholds
43+
run: |
44+
COVERAGE=$(cargo llvm-cov --workspace --lib --bins --tests --all-features --json | jq -r '.data[0].totals.percent_covered')
45+
echo "Current coverage: ${COVERAGE}%"
46+
THRESHOLD=80
47+
if (( $(echo "$COVERAGE >= $THRESHOLD" | bc -l) )); then
48+
echo "✅ Coverage threshold met: ${COVERAGE}% >= ${THRESHOLD}%"
49+
else
50+
echo "❌ Coverage threshold NOT met: ${COVERAGE}% < ${THRESHOLD}%"
51+
exit 1
52+
fi
53+
54+
- name: Upload coverage to Codecov
55+
uses: codecov/codecov-action@v3
56+
with:
57+
file: lcov.info
58+
flags: unittests
59+
name: codecov-umbrella
60+
61+
- name: Upload coverage artifacts
62+
uses: actions/upload-artifact@v3
63+
with:
64+
name: coverage-report
65+
path: target/llvm-cov/html/
66+
67+
- name: Run integration tests
68+
run: cargo test --workspace --test cross_chain_integration
69+
70+
- name: Run comprehensive integration tests
71+
run: |
72+
cd testing/integration
73+
cargo test --lib
74+
75+
- name: Security audit
76+
run: cargo audit --ignore RUSTSEC-2023-0052
77+
78+
- name: Check dependencies
79+
run: cargo deny check
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Test Coverage Report
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
coverage:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Rust toolchain
16+
uses: dtolnay/rust-toolchain@stable
17+
with:
18+
components: llvm-tools-preview
19+
20+
- name: Cache cargo
21+
uses: Swatinem/rust-cache@v2
22+
23+
- name: Install cargo-llvm-cov
24+
run: cargo install cargo-llvm-cov
25+
26+
- name: Generate coverage report
27+
run: |
28+
cargo llvm-cov --workspace --lib --bins --tests --all-features --lcov --output-path lcov.info
29+
cargo llvm-cov --workspace --lib --bins --tests --all-features --html
30+
31+
- name: Coverage threshold check
32+
run: |
33+
COVERAGE=$(cargo llvm-cov --workspace --lib --bins --tests --all-features --json | jq -r '.data[0].totals.percent_covered')
34+
echo "📊 Current Coverage: ${COVERAGE}%"
35+
36+
# Set minimum coverage threshold
37+
THRESHOLD=80
38+
39+
if (( $(echo "$COVERAGE >= $THRESHOLD" | bc -l) )); then
40+
echo "✅ Coverage threshold met: ${COVERAGE}% >= ${THRESHOLD}%"
41+
echo "coverage=${COVERAGE}" >> $GITHUB_OUTPUT
42+
else
43+
echo "❌ Coverage threshold NOT met: ${COVERAGE}% < ${THRESHOLD}%"
44+
echo "coverage=${COVERAGE}" >> $GITHUB_OUTPUT
45+
exit 1
46+
fi
47+
id: coverage
48+
49+
- name: Upload coverage to Codecov
50+
uses: codecov/codecov-action@v3
51+
with:
52+
file: lcov.info
53+
flags: unittests
54+
name: codecov-umbrella
55+
fail_ci_if_error: false
56+
57+
- name: Upload coverage artifacts
58+
uses: actions/upload-artifact@v3
59+
with:
60+
name: coverage-report-${{ github.sha }}
61+
path: target/llvm-cov/html/
62+
retention-days: 30
63+
64+
- name: Coverage comment
65+
if: github.event_name == 'pull_request'
66+
uses: actions/github-script@v6
67+
with:
68+
script: |
69+
const coverage = '${{ steps.coverage.outputs.coverage }}';
70+
const threshold = 80;
71+
72+
const comment = `## 📊 Test Coverage Report
73+
74+
**Current Coverage:** ${coverage}%
75+
**Required Threshold:** ${threshold}%
76+
**Status:** ${coverage >= threshold ? '✅ PASS' : '❌ FAIL'}
77+
78+
${coverage >= threshold ?
79+
'Great job! The test coverage meets the minimum requirements.' :
80+
'Test coverage is below the minimum threshold. Please add more tests to improve coverage.'}
81+
82+
---
83+
*This comment was automatically generated by the coverage check workflow.*`;
84+
85+
github.rest.issues.createComment({
86+
issue_number: context.issue.number,
87+
owner: context.repo.owner,
88+
repo: context.repo.repo,
89+
body: comment
90+
});

.github/workflows/docs-validation.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)