Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 11 additions & 67 deletions .github/workflows/snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,61 +196,8 @@ jobs:
MODE: content
run: pnpm run check:stellar-testnet

# NON-BLOCKING: live provider availability checks.
#
# continue-on-error keeps the job alive regardless of exit status, but it
# collapses outcome/conclusion so we cannot distinguish exit 1 from exit 2
# through those fields alone. We therefore capture the raw exit status
# explicitly and write it to GITHUB_OUTPUT before the shell exits, giving
# the next step a reliable signal to branch on.
#
# Exit codes (defined in check-stellar-testnet-snippets.ts):
# 0 – all checks passed
# 1 – content regression → hard failure, blocks merge
# 2 – provider outage → warning annotation only, does NOT block
- name: Validate Stellar testnet provider availability (non-blocking)
id: provider-check
continue-on-error: true
env:
MODE: provider
run: |
set +e
pnpm run check:stellar-testnet
STATUS=$?
set -e
echo "exit-status=$STATUS" >> "$GITHUB_OUTPUT"
exit $STATUS

# Exit 1 → content regression from a reachable provider; hard-fail.
# Exit 2 → provider outage; emit a warning annotation and continue.
# Exit 0 → all good; nothing to do.
- name: Classify provider-check exit status
if: always()
env:
PROVIDER_EXIT: ${{ steps.provider-check.outputs.exit-status }}
run: |
case "$PROVIDER_EXIT" in
0)
echo "Provider check passed."
;;
1)
echo "::error::Provider step detected a content regression (exit 1). Failing the job."
exit 1
;;
2)
echo "::warning::Provider step reported a testnet outage (exit 2). Non-blocking."
;;
*)
echo "::error::Provider step exited with unexpected status '$PROVIDER_EXIT'. Failing the job."
exit 1
;;
esac

- name: Test exit-status classification logic
run: pnpm run test:stellar-testnet

mint-validation:
name: Mint config validation and preview redirect checks
broken-links:
name: Broken-link check
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -270,20 +217,17 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate Mint navigation and configuration
run: npx --yes mintlify@4.2.1082 validate

- name: Run preview redirect unit tests
run: pnpm run test:preview-redirect
# Internal-only check runs on every PR (fast, no network).
# External check runs additionally on pushes to develop / main.
- name: Check internal links (routes, anchors, assets)
run: pnpm run check:broken-links:internal

# The live preview check needs a deployed Mintlify preview. It is only
# required when that URL is actually supplied — without one there is
# nothing to verify, and the unit tests above already cover the
# redirect logic.
- name: Verify live preview redirect
if: ${{ env.MINTLIFY_PREVIEW_URL != '' }}
run: node scripts/check-preview-redirect.mjs
- name: Check external links
if: github.event_name == 'push'
run: pnpm run check:broken-links

- name: Test broken links SSRF protection
run: pnpm run test:broken-links

playground-smoke:
name: Playground smoke test
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
"test:playground": "playwright test --config scripts/playground/tests/playwright.config.ts",
"mint:validate": "mint validate",
"mint:broken-links": "mint broken-links",
"test": "npm run check:snippets && npm run check:integration-guides && npm run check:nav-coverage && npm run check:contract-registry && npm run check:compatibility-matrix && npm run test:redirects-and-anchors && npm run test:compatibility-matrix"
"check:broken-links": "node scripts/check-broken-links.mjs",
"check:broken-links:internal": "node scripts/check-broken-links.mjs --no-external",
"test:broken-links": "node scripts/check-broken-links.test.mjs",
"test": "npm run check:snippets && npm run check:nav-coverage && npm run check:contract-registry && npm run check:compatibility-matrix && npm run test:redirects-and-anchors && npm run test:broken-links"
},
"dependencies": {
"@solana/web3.js": "^1.99.0",
Expand Down
Loading
Loading