fix(docs): Readme example (#104) #191
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.20.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Cache Turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-lint-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo-lint- | |
| ${{ runner.os }}-turbo- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run lint | |
| run: pnpm lint | |
| build: | |
| name: Build Packages | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.20.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Cache Turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-build-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo-build- | |
| ${{ runner.os }}-turbo- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build workspace | |
| run: pnpm build | |
| - name: Run type smoke tests | |
| run: pnpm --filter @solana/test-types-smoke test | |
| typecheck: | |
| name: Typecheck | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.20.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Cache Turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-typecheck-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo-typecheck- | |
| ${{ runner.os }}-turbo- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run typecheck | |
| run: pnpm typecheck | |
| test: | |
| name: Test & Coverage | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.20.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Cache Turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-test-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo-test- | |
| ${{ runner.os }}-turbo- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Run tests with coverage | |
| run: pnpm --filter=!@solana/test-types-smoke test -- --coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage/lcov.info | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| size: | |
| name: Check Bundle Size | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.20.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Cache Turbo | |
| uses: actions/cache@v4 | |
| with: | |
| path: .turbo | |
| key: ${{ runner.os }}-turbo-size-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-turbo-size- | |
| ${{ runner.os }}-turbo- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build packages | |
| run: pnpm build | |
| - name: Check bundle size limits | |
| run: pnpm size-limit | |
| changeset: | |
| name: Require Changeset | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.20.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Check for changeset | |
| run: | | |
| # Check if this PR has a skip-changeset label | |
| if gh pr view ${{ github.event.pull_request.number }} --json labels --jq '.labels[].name' | grep -q 'skip-changeset'; then | |
| echo "Skipping changeset check due to skip-changeset label" | |
| exit 0 | |
| fi | |
| # Check if there are any new changeset files | |
| CHANGESETS=$(git diff --name-only origin/main...HEAD -- '.changeset/*.md' | grep -v 'README.md' || true) | |
| if [ -z "$CHANGESETS" ]; then | |
| echo "::error::No changeset found. Please run 'pnpm changeset' to create one." | |
| echo "" | |
| echo "If this PR doesn't require a version bump (e.g., docs-only changes)," | |
| echo "add the 'skip-changeset' label to bypass this check." | |
| exit 1 | |
| fi | |
| echo "Found changeset(s):" | |
| echo "$CHANGESETS" | |
| env: | |
| GH_TOKEN: ${{ github.token }} |