From 0777316da40dff4667c91faf42e9e5b506f41814 Mon Sep 17 00:00:00 2001 From: Mosas2000 Date: Mon, 19 Oct 2026 14:57:14 +0100 Subject: [PATCH] Add spell check and link validation for documentation - Implements cspell with project dictionary for common terms - Adds lychee link checker to validate internal and external links - Includes npm license allowlist validation for dependencies - Generates SBOM artifacts for release transparency Resolves #1664, #1665, #1666, #1667 --- .github/workflows/dependency-security.yml | 33 +++++++++++++ .github/workflows/docs.yml | 29 ++++++++++++ .github/workflows/release.yml | 45 +++++++++++++++++- cspell.json | 56 +++++++++++++++++++++++ 4 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 cspell.json diff --git a/.github/workflows/dependency-security.yml b/.github/workflows/dependency-security.yml index 4200be928..73ed7c16d 100644 --- a/.github/workflows/dependency-security.yml +++ b/.github/workflows/dependency-security.yml @@ -86,3 +86,36 @@ jobs: uses: actions/dependency-review-action@v4 with: fail-on-severity: high + + npm-license-check: + name: NPM License Check + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Enable Corepack & Setup pnpm + run: | + corepack enable + corepack prepare pnpm@9.12.0 --activate + + - name: Install Dependencies + run: pnpm install --frozen-lockfile + + - name: Install license-checker + run: npm install -g license-checker-rseidelsohn + + - name: Check Frontend Licenses + working-directory: ./frontend + run: | + license-checker --onlyAllow "MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;0BSD;CC0-1.0;Unlicense;Python-2.0;CC-BY-3.0;CC-BY-4.0" --summary + + - name: Check Backend Licenses + working-directory: ./backend + run: | + license-checker --onlyAllow "MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;0BSD;CC0-1.0;Unlicense;Python-2.0;CC-BY-3.0;CC-BY-4.0" --summary diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 21c0733dc..b742bf018 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,3 +25,32 @@ jobs: cargo doc -p share-price-math --no-deps cargo doc -p mock-strategy --no-deps continue-on-error: false + + spell-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install cspell + run: npm install -g cspell + + - name: Run spell check + run: cspell "**/*.md" --config cspell.json + + link-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Check links + uses: lycheeverse/lychee-action@v1 + with: + args: --verbose --no-progress --accept 200,403,429 --timeout 30 --max-retries 3 '**/*.md' + fail: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8225bf0c4..2d60f3c38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,47 @@ jobs: branch: "chore/changelog-${{ github.ref_name }}" base: "main" - # Create the GitHub Release with the generated notes + # Build Rust workspace + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Build Rust workspace + run: cargo build --release --workspace + + # Build frontend + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Enable Corepack + run: | + corepack enable + corepack prepare pnpm@9.12.0 --activate + + - name: Install frontend dependencies + working-directory: ./frontend + run: pnpm install --frozen-lockfile + + - name: Build frontend + working-directory: ./frontend + run: pnpm build + + # Generate SBOM for Rust workspace + - name: Install cargo-sbom + run: cargo install cargo-sbom + + - name: Generate Rust SBOM + run: cargo sbom --output-format spdx_json_2_3 > rust-sbom.spdx.json + + # Generate SBOM for frontend + - name: Generate Frontend SBOM + working-directory: ./frontend + run: | + npm install -g @cyclonedx/cyclonedx-npm + cyclonedx-npm --output-file ../frontend-sbom.json + + # Create the GitHub Release with the generated notes and SBOMs - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: @@ -62,3 +102,6 @@ jobs: body_path: /tmp/release-notes.md draft: false prerelease: ${{ contains(github.ref_name, '-') }} + files: | + rust-sbom.spdx.json + frontend-sbom.json diff --git a/cspell.json b/cspell.json new file mode 100644 index 000000000..43aea07b8 --- /dev/null +++ b/cspell.json @@ -0,0 +1,56 @@ +{ + "version": "0.2", + "language": "en-US", + "words": [ + "Soroban", + "Freighter", + "yvUSDC", + "USDC", + "XLM", + "Stellar", + "blockchain", + "smartcontract", + "smartcontracts", + "testnet", + "mainnet", + "keypair", + "keypairs", + "Junirezz", + "YieldVault", + "RWA", + "Rustc", + "Wasm", + "WASM", + "rustup", + "pnpm", + "typecheck", + "SBOM", + "SPDX", + "CycloneDX", + "lockfile", + "codeowners", + "repo", + "Github", + "deps", + "codeql", + "slither", + "gitleaks", + "clippy", + "rustfmt" + ], + "ignorePaths": [ + "node_modules", + "target", + "dist", + "build", + "*.lock", + "*.log", + "coverage", + ".git" + ], + "ignoreRegExpList": [ + "/0x[0-9a-fA-F]+/", + "/[A-Z0-9]{56}/", + "/G[A-Z0-9]{55}/" + ] +}