Skip to content

Add helper to fetch SDK artifacts directly from Github #617

Add helper to fetch SDK artifacts directly from Github

Add helper to fetch SDK artifacts directly from Github #617

Workflow file for this run

name: Packages
on:
push:
branches: [main]
pull_request:
branches: [main, new-try-it-now]
merge_group:
jobs:
lint-and-check:
name: Lint and Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build packages
run: make build-packages
- name: Type check
run: make type-check-packages
- name: Lint
run: make lint-packages
- name: Check formatting
run: make check-formatting-packages
- name: Verify package versions
run: make verify-package-versions
integration-tests:
name: Integration Tests - ${{ matrix.example }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: [docusaurus, nextra]
steps:
- uses: actions/checkout@v4
with:
# Needed to copy the WASM file during build
lfs: true
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build packages
run: make build-packages
- name: Build example
run: npm run build --workspace examples/${{ matrix.example }} --ignore-scripts
- name: Get Playwright version
id: playwright-version
run: echo "version=$(npx playwright --version | sed 's/Version //')" >> $GITHUB_OUTPUT
working-directory: tests/integration/${{ matrix.example }}
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
working-directory: tests/integration/${{ matrix.example }}
- name: Run Playwright tests
run: npm test
working-directory: tests/integration/${{ matrix.example }}
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.example }}
path: tests/integration/${{ matrix.example }}/playwright-report/
retention-days: 30
# Summary job for branch protection
packages-success:
name: Packages Build and Lint
runs-on: ubuntu-latest
needs: [lint-and-check, integration-tests]
if: always()
steps:
- name: Check if all jobs succeeded
if: needs.lint-and-check.result != 'success' || needs.integration-tests.result != 'success'
run: exit 1