Skip to content

chore(ci): group vitest + @vitest/* in dependabot to prevent peer-mismatch #91

chore(ci): group vitest + @vitest/* in dependabot to prevent peer-mismatch

chore(ci): group vitest + @vitest/* in dependabot to prevent peer-mismatch #91

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with: { version: 10.24.0 }
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with: { node-version: 24, cache: pnpm }
- uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1
with: { rustflags: "" }
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack 0.14.0
run: cargo install wasm-pack --version 0.14.0 --locked
- run: pnpm install --frozen-lockfile
- run: pnpm -r build
- run: pnpm -r lint
- run: pnpm -r test
- run: cargo build --manifest-path packages/codec/Cargo.toml --release
- run: cargo test --manifest-path packages/codec/Cargo.toml
- name: Assert size budgets
run: bash scripts/assert-size.sh
working-directory: packages/codec
- run: |
for dir in packages/codec packages/types packages/networks; do
(cd "$dir" && npm pack --dry-run)
done
vector-parity:
needs: [lint-and-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with: { version: 10.24.0 }
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with: { node-version: 24, cache: pnpm }
- uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1
with: { rustflags: "" }
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack 0.14.0
run: cargo install wasm-pack --version 0.14.0 --locked
- run: pnpm install --frozen-lockfile
- run: pnpm -r build
- name: TS/JS parity (vitest)
run: pnpm -C packages/codec exec vitest run tests/parity.test.ts --coverage.enabled=false
- name: Rust parity (cargo)
run: cargo test --manifest-path packages/codec/Cargo.toml --test parity_roundtrip --test parity_malformed
ts-rust-parity:
# Requires VOIDPAY_READ_TOKEN secret (fine-grained PAT: contents:read on ignromanov/voidpay).
# Skipped automatically on fork PRs where the secret is absent.
# To enable: set vars.TS_RUST_PARITY_ENABLED=true AND add secret VOIDPAY_READ_TOKEN in repo Settings.
needs: [lint-and-build]
runs-on: ubuntu-latest
if: ${{ vars.TS_RUST_PARITY_ENABLED == 'true' }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Checkout vl/app at pinned SHA (sparse — codec files only)
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
repository: ignromanov/voidpay
ref: e4926b7f7b08ca4f72b707df8796bfd4a4b0a3b3
token: ${{ secrets.VOIDPAY_READ_TOKEN }}
path: vl-app
sparse-checkout: |
src/features/invoice-codec
src/shared/lib/tlv-codec
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with: { version: 10.24.0 }
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with: { node-version: 24, cache: pnpm }
- uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1
with: { rustflags: "" }
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack 0.14.0
run: cargo install wasm-pack --version 0.14.0 --locked
- run: pnpm install --frozen-lockfile
- run: pnpm -r build
- name: Run cross-impl parity (Rust WASM vs TS reference)
run: VL_APP_PATH=${{ github.workspace }}/vl-app pnpm -C packages/codec run test:ts-rust-parity
macos-sanity:
runs-on: macos-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: cargo test --manifest-path packages/codec/Cargo.toml
test-wasm-node:
needs: [lint-and-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1
with: { rustflags: "" }
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- run: rustup target add wasm32-unknown-unknown
- name: Install wasm-pack 0.14.0
run: cargo install wasm-pack --version 0.14.0 --locked
- name: Run wasm-pack test --node (AC-9 boundary tests)
run: wasm-pack test --node packages/codec
ci-gate:
# Single required branch-protection check. All non-parity jobs must succeed;
# ts-rust-parity may be SKIPPED only when vars.TS_RUST_PARITY_ENABLED != 'true'
# (opt-out for forks or repos without VOIDPAY_READ_TOKEN secret).
needs: [lint-and-build, macos-sanity, vector-parity, test-wasm-node, ts-rust-parity]
if: always()
runs-on: ubuntu-latest
steps:
- name: Verify required jobs (parity opt-out aware)
run: |
fail=0
check() {
local name=$1 result=$2
if [ "$result" != "success" ]; then
echo "❌ $name: $result"
fail=1
else
echo "✅ $name: $result"
fi
}
check "lint-and-build" "${{ needs.lint-and-build.result }}"
check "macos-sanity" "${{ needs.macos-sanity.result }}"
check "vector-parity" "${{ needs.vector-parity.result }}"
check "test-wasm-node" "${{ needs.test-wasm-node.result }}"
parity_result="${{ needs.ts-rust-parity.result }}"
parity_enabled="${{ vars.TS_RUST_PARITY_ENABLED }}"
if [ "$parity_enabled" = "true" ]; then
check "ts-rust-parity (enabled)" "$parity_result"
else
# opt-out path: skipped or success both acceptable
if [ "$parity_result" = "skipped" ] || [ "$parity_result" = "success" ]; then
echo "✅ ts-rust-parity ($parity_result; disabled via vars.TS_RUST_PARITY_ENABLED)"
else
echo "❌ ts-rust-parity: $parity_result"
fail=1
fi
fi
exit $fail