Skip to content

Commit 7984146

Browse files
committed
feat: implemented all issues and resolved merge conflicts
2 parents 9d15094 + dd60ef8 commit 7984146

150 files changed

Lines changed: 43107 additions & 4616 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.

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: read
9+
pull-requests: write
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}
@@ -64,6 +65,68 @@ jobs:
6465
- name: Type-check & build
6566
run: pnpm run build
6667

68+
- name: Get baseline bundle size
69+
id: baseline
70+
if: github.event_name == 'pull_request'
71+
run: |
72+
BASE_SHA="${{ github.base_ref }}"
73+
git fetch origin "$BASE_SHA" --depth=1
74+
BASELINE=$(git show "origin/$BASE_SHA:frontend/dist/assets" 2>/dev/null | grep -oP '\d+ KB' | head -1 || echo "unknown")
75+
echo "size=$BASELINE" >> $GITHUB_OUTPUT
76+
77+
- name: Analyze bundle size
78+
id: bundle
79+
run: |
80+
cd dist
81+
TOTAL_SIZE=$(du -sh . | cut -f1)
82+
ASSETS_SIZE=$(du -sh assets | cut -f1)
83+
echo "total_size=$TOTAL_SIZE" >> $GITHUB_OUTPUT
84+
echo "assets_size=$ASSETS_SIZE" >> $GITHUB_OUTPUT
85+
86+
echo "### Bundle Size Report" >> $GITHUB_STEP_SUMMARY
87+
echo "" >> $GITHUB_STEP_SUMMARY
88+
echo "| Metric | Size |" >> $GITHUB_STEP_SUMMARY
89+
echo "|--------|------|" >> $GITHUB_STEP_SUMMARY
90+
echo "| Total dist | $TOTAL_SIZE |" >> $GITHUB_STEP_SUMMARY
91+
echo "| Assets | $ASSETS_SIZE |" >> $GITHUB_STEP_SUMMARY
92+
93+
- name: Comment bundle size
94+
if: github.event_name == 'pull_request'
95+
uses: actions/github-script@v8
96+
with:
97+
script: |
98+
const { total_size, assets_size } = process.env;
99+
const body = `## 📦 Bundle Size Report\n\n| Metric | Size |\n|--------|------|\n| Total dist | ${total_size} |\n| Assets | ${assets_size} |\n\n_This helps track frontend bundle size changes._`;
100+
101+
const { data: comments } = await github.rest.issues.listComments({
102+
owner: context.repo.owner,
103+
repo: context.repo.repo,
104+
issue_number: context.issue.number,
105+
});
106+
107+
const botComment = comments.find(c =>
108+
c.user.type === 'Bot' && c.body.includes('Bundle Size Report')
109+
);
110+
111+
if (botComment) {
112+
await github.rest.issues.updateComment({
113+
owner: context.repo.owner,
114+
repo: context.repo.repo,
115+
comment_id: botComment.id,
116+
body: body
117+
});
118+
} else {
119+
await github.rest.issues.createComment({
120+
owner: context.repo.owner,
121+
repo: context.repo.repo,
122+
issue_number: context.issue.number,
123+
body: body
124+
});
125+
}
126+
env:
127+
total_size: ${{ steps.bundle.outputs.total_size }}
128+
assets_size: ${{ steps.bundle.outputs.assets_size }}
129+
67130
# ── Contracts: fmt + clippy + test + build WASM ──────────────────
68131
contracts:
69132
needs: changes

.github/workflows/coverage.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
18+
jobs:
19+
coverage:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v6
23+
24+
- uses: actions-rust-lang/setup-rust-toolchain@v1
25+
with:
26+
toolchain: stable
27+
components: llvm-tools-preview
28+
29+
- name: Install cargo-llvm-cov
30+
uses: taiki-e/install-action@cargo-llvm-cov
31+
32+
- name: Cache cargo
33+
uses: actions/cache@v5
34+
with:
35+
path: |
36+
~/.cargo/registry
37+
~/.cargo/git
38+
target
39+
key: ${{ runner.os }}-coverage-${{ hashFiles('**/Cargo.lock') }}
40+
restore-keys: ${{ runner.os }}-coverage-
41+
42+
- name: Generate coverage report
43+
run: |
44+
cargo llvm-cov \
45+
--workspace \
46+
--lcov \
47+
--output-path lcov.info \
48+
--features testutils \
49+
-- --test-threads=1
50+
51+
- name: Upload to Codecov
52+
uses: codecov/codecov-action@v5
53+
with:
54+
files: lcov.info
55+
fail_ci_if_error: true
56+
57+
- name: Post coverage comment on PR
58+
uses: romeovs/lcov-reporter-action@v0.4.0
59+
with:
60+
lcov-file: ./lcov.info
61+
github-token: ${{ secrets.GITHUB_TOKEN }}
62+
delete-old-comments: true

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -18,64 +18,10 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
# ── Auto-label ───────────────────────────────────────────────────
22-
# 1. File paths → area labels (contracts, frontend, infrastructure, etc.)
23-
# 2. PR title prefix → type labels (enhancement, bug, docs, etc.)
24-
auto-label:
25-
if: >-
26-
github.event.action == 'opened' &&
27-
github.event.pull_request.user.login != 'github-actions[bot]' &&
28-
github.event.pull_request.user.login != 'release-please[bot]' &&
29-
github.event.pull_request.user.login != 'dependabot[bot]'
30-
runs-on: ubuntu-latest
31-
steps:
32-
- uses: actions/checkout@v6
33-
- name: Label by file paths
34-
uses: actions/labeler@v6
35-
with:
36-
repo-token: ${{ secrets.GITHUB_TOKEN }}
37-
configuration-path: .github/labeler.yml
38-
sync-labels: false
39-
40-
- name: Label by PR title prefix
41-
env:
42-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
run: |
44-
TITLE="${{ github.event.pull_request.title }}"
45-
PR_NUM="${{ github.event.pull_request.number }}"
46-
REPO="${{ github.repository }}"
47-
48-
PREFIX=$(echo "$TITLE" | grep -oP '^\w+' || echo "")
49-
50-
case "$PREFIX" in
51-
feat) LABEL="enhancement" ;;
52-
fix) LABEL="bug" ;;
53-
docs) LABEL="documentation" ;;
54-
refactor) LABEL="refactor" ;;
55-
test) LABEL="tests" ;;
56-
ci|build) LABEL="infrastructure" ;;
57-
security) LABEL="security" ;;
58-
perf) LABEL="enhancement" ;;
59-
*) LABEL="" ;;
60-
esac
61-
62-
if [ -n "$LABEL" ]; then
63-
HAS=$(gh pr view "$PR_NUM" --repo "$REPO" --json labels \
64-
-q "[.labels[].name] | any(. == \"$LABEL\")")
65-
if [ "$HAS" != "true" ]; then
66-
gh pr edit "$PR_NUM" --repo "$REPO" --add-label "$LABEL"
67-
echo "Added: $LABEL"
68-
fi
69-
fi
70-
7121
# ── PR quality checks ───────────────────────────────────────────
72-
# Waits for auto-label so labels exist before we check them.
73-
# !failure() lets this run when auto-label succeeds OR is skipped
74-
# (skipped on labeled/unlabeled events), but blocks on failure.
22+
# Labels are managed by the reviewer, not automated.
7523
pr-checks:
76-
needs: auto-label
7724
if: >-
78-
!failure() &&
7925
github.event.pull_request.user.login != 'github-actions[bot]' &&
8026
github.event.pull_request.user.login != 'release-please[bot]' &&
8127
github.event.pull_request.user.login != 'dependabot[bot]'
@@ -146,19 +92,3 @@ jobs:
14692
14793
echo "::error::PR must link to an issue. Use 'Closes #N' in the description, or link via the Development sidebar. Add the 'no-issue' label for trivial changes."
14894
exit 1
149-
150-
- name: Check labels
151-
env:
152-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153-
run: |
154-
# Re-fetch labels (auto-label may have just added some)
155-
LABEL_COUNT=$(gh pr view ${{ github.event.pull_request.number }} \
156-
--repo "${{ github.repository }}" --json labels \
157-
-q '.labels | length')
158-
159-
if [ "$LABEL_COUNT" -eq 0 ]; then
160-
echo "::error::PR must have at least one label. Labels are usually added automatically from the PR title and changed files. If auto-labeling didn't trigger, add a label manually."
161-
exit 1
162-
fi
163-
164-
echo "PR has $LABEL_COUNT label(s)"

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ name: Release
1010
# ALL commit types + contributors + full changelog link
1111

1212
on:
13-
push:
14-
branches: [main]
13+
workflow_dispatch:
1514

1615
permissions:
1716
contents: write

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ frontend/dist
2020
.env
2121
.env.local
2222
pr.md
23-
issue.md
23+
issue.md

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npx lint-staged
1+
cd frontend && npx lint-staged

.lintstagedrc

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

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Thanks for your interest in contributing. Lernza is an open source learn-to-earn
1212

1313
## Development Setup
1414

15+
For detailed setup instructions, see [DEV_SETUP.md](DEV_SETUP.md).
16+
1517
### Smart Contracts (Rust/Soroban)
1618

1719
```bash

0 commit comments

Comments
 (0)