Skip to content

Commit ddcf88f

Browse files
authored
Merge branch 'main' into movement
2 parents 56855b0 + df039aa commit ddcf88f

112 files changed

Lines changed: 14632 additions & 9020 deletions

File tree

Some content is hidden

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

.cargo/config.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
[alias]
2-
# This allows you to launch your tool by just typing 'cargo dev'
3-
dev = "run -p streller-cli"
2+
dev = "run -p streller-cli"
3+
4+
[target.x86_64-pc-windows-msvc]
5+
linker = "clang"
6+
7+
[target.x86_64-pc-windows-gnu]
8+
linker = "clang"
9+
10+
[build]
11+
target = "x86_64-pc-windows-gnu"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Accessibility Tests
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
accessibility:
11+
name: WCAG AA Accessibility
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 15
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: "20"
22+
cache: "npm"
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Install Playwright browsers
28+
run: npx playwright install chromium --with-deps
29+
30+
- name: Run accessibility tests
31+
run: npm run a11y:test
32+
33+
- name: Upload accessibility report
34+
if: always()
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: accessibility-report
38+
path: |
39+
visual-tests/accessibility-report/
40+
visual-tests/accessibility-reports/
41+
42+
- name: Summarize violations in PR
43+
if: failure()
44+
run: |
45+
echo "## ❌ Accessibility Violations Found" >> $GITHUB_STEP_SUMMARY
46+
echo "" >> $GITHUB_STEP_SUMMARY
47+
if [ -f visual-tests/accessibility-reports/wcag-aa-chromium.json ]; then
48+
echo "### WCAG AA Report" >> $GITHUB_STEP_SUMMARY
49+
echo '```json' >> $GITHUB_STEP_SUMMARY
50+
cat visual-tests/accessibility-reports/wcag-aa-chromium.json >> $GITHUB_STEP_SUMMARY
51+
echo '```' >> $GITHUB_STEP_SUMMARY
52+
fi
53+
echo "" >> $GITHUB_STEP_SUMMARY
54+
echo "Download the full **accessibility-report** artifact for detailed remediation guidance." >> $GITHUB_STEP_SUMMARY
55+
56+
- name: Post success summary
57+
if: success()
58+
run: |
59+
echo "## ✅ Accessibility Tests Passed" >> $GITHUB_STEP_SUMMARY
60+
echo "" >> $GITHUB_STEP_SUMMARY
61+
echo "All WCAG 2.1 AA checks passed:" >> $GITHUB_STEP_SUMMARY
62+
echo "- ✅ WCAG AA compliance (axe-core)" >> $GITHUB_STEP_SUMMARY
63+
echo "- ✅ Color contrast validation" >> $GITHUB_STEP_SUMMARY
64+
echo "- ✅ Keyboard navigation" >> $GITHUB_STEP_SUMMARY
65+
echo "- ✅ Screen reader attributes (ARIA, roles, labels)" >> $GITHUB_STEP_SUMMARY
66+
echo "- ✅ Skip navigation link" >> $GITHUB_STEP_SUMMARY
67+
echo "- ✅ Landmark regions" >> $GITHUB_STEP_SUMMARY

.github/workflows/ci.yml

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,48 @@ jobs:
9999
restore-keys: |
100100
${{ runner.os }}-cargo-test-
101101
${{ runner.os }}-cargo-
102-
102+
103103
- name: Run unit tests
104104
run: cargo test --workspace --exclude e2e-tests --verbose
105105

106+
coverage:
107+
name: Contract Coverage Gate
108+
runs-on: ubuntu-latest
109+
steps:
110+
- uses: actions/checkout@v4
111+
112+
- name: Install Rust toolchain
113+
uses: dtolnay/rust-toolchain@stable
114+
with:
115+
components: llvm-tools-preview
116+
117+
- name: Cache cargo registry
118+
uses: actions/cache@v4
119+
with:
120+
path: |
121+
~/.cargo/registry
122+
~/.cargo/git
123+
target
124+
key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
125+
restore-keys: |
126+
${{ runner.os }}-cargo-coverage-
127+
${{ runner.os }}-cargo-
128+
129+
- name: Install cargo-llvm-cov
130+
uses: taiki-e/install-action@cargo-llvm-cov
131+
132+
- name: Run 95% coverage gate
133+
run: ./scripts/test-coverage.sh --gate 95 --lcov
134+
135+
- name: Upload coverage reports
136+
uses: actions/upload-artifact@v4
137+
if: always()
138+
with:
139+
name: contract-coverage
140+
path: |
141+
target/coverage/
142+
target/coverage-reports/
143+
106144
performance:
107145
name: Performance Regression
108146
runs-on: ubuntu-latest
@@ -132,7 +170,7 @@ jobs:
132170
- uses: actions/checkout@v4
133171

134172
- name: Setup Node.js
135-
uses: actions/setup-node@v4
173+
uses: actions/setup-node@v6
136174
with:
137175
node-version: "20"
138176
cache: "npm"
@@ -159,10 +197,41 @@ jobs:
159197
visual-tests/test-results
160198
visual-tests/tests/__screenshots__
161199
200+
accessibility:
201+
name: Accessibility (WCAG AA)
202+
runs-on: ubuntu-latest
203+
timeout-minutes: 15
204+
steps:
205+
- uses: actions/checkout@v4
206+
207+
- name: Setup Node.js
208+
uses: actions/setup-node@v4
209+
with:
210+
node-version: "20"
211+
cache: "npm"
212+
213+
- name: Install dependencies
214+
run: npm ci
215+
216+
- name: Install Playwright browsers
217+
run: npx playwright install chromium --with-deps
218+
219+
- name: Run accessibility tests
220+
run: npm run a11y:test
221+
222+
- name: Upload accessibility report
223+
if: always()
224+
uses: actions/upload-artifact@v4
225+
with:
226+
name: accessibility-report
227+
path: |
228+
visual-tests/accessibility-report/
229+
visual-tests/accessibility-reports/
230+
162231
ci-success:
163232
name: CI Success
164233
runs-on: ubuntu-latest
165-
needs: [format, clippy, build, test, performance, visual-regression]
234+
needs: [format, clippy, build, test, coverage, performance, visual-regression]
166235
if: always()
167236
steps:
168237
- name: Check all jobs
@@ -171,15 +240,19 @@ jobs:
171240
"${{ needs.clippy.result }}" != "success" || \
172241
"${{ needs.build.result }}" != "success" || \
173242
"${{ needs.test.result }}" != "success" || \
243+
"${{ needs.coverage.result }}" != "success" || \
174244
"${{ needs.performance.result }}" != "success" || \
175-
"${{ needs.visual-regression.result }}" != "success" ]]; then
245+
"${{ needs.visual-regression.result }}" != "success" || \
246+
"${{ needs.accessibility.result }}" != "success" ]]; then
176247
echo "One or more CI jobs failed"
177248
echo "Format: ${{ needs.format.result }}"
178249
echo "Clippy: ${{ needs.clippy.result }}"
179250
echo "Build: ${{ needs.build.result }}"
180251
echo "Test: ${{ needs.test.result }}"
252+
echo "Coverage: ${{ needs.coverage.result }}"
181253
echo "Performance: ${{ needs.performance.result }}"
182254
echo "Visual Regression: ${{ needs.visual-regression.result }}"
255+
echo "Accessibility: ${{ needs.accessibility.result }}"
183256
exit 1
184257
fi
185258
echo "✅ All CI jobs passed successfully"

.github/workflows/load-testing.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Continuous Load Testing
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *' # Run daily at 2 AM UTC
6+
workflow_dispatch:
7+
inputs:
8+
users:
9+
description: 'Number of users to simulate'
10+
required: true
11+
default: '10000'
12+
13+
jobs:
14+
load-test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Setup Rust
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
target: wasm32-unknown-unknown
25+
override: true
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: '18'
31+
32+
- name: Start Soroban Localnet
33+
run: ./scripts/localnet-up.sh
34+
35+
- name: Build Smart Contracts
36+
run: ./scripts/build.sh
37+
38+
- name: Run Load Tests (10k Users)
39+
env:
40+
LOAD_TEST_REQUESTS: ${{ github.event.inputs.users || '10000' }}
41+
run: |
42+
cargo test --test load_testing -- --ignored --nocapture > load-test-results.txt
43+
44+
- name: Parse and Track Baseline Metrics
45+
run: |
46+
THROUGHPUT=$(grep -oP 'Throughput: \K[0-9.]+' load-test-results.txt | head -1)
47+
echo "Achieved Throughput: $THROUGHPUT ops/sec"
48+
49+
# Alert if performance drops below baseline of 50 ops/sec
50+
if (( $(echo "$THROUGHPUT < 50.0" | bc -l) )); then
51+
echo "::error title=Performance Regression::Throughput fell below baseline of 50 ops/sec (Current: $THROUGHPUT)"
52+
exit 1
53+
fi
54+
55+
- name: Upload Test Artifacts
56+
if: always()
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: load-test-results
60+
path: load-test-results.txt
61+
62+
- name: Stop Localnet
63+
if: always()
64+
run: ./scripts/localnet-down.sh

0 commit comments

Comments
 (0)