Skip to content

[pull] main from liveblocks:main #550

[pull] main from liveblocks:main

[pull] main from liveblocks:main #550

Workflow file for this run

name: Tests
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.4.1]
pkg:
[
"@liveblocks/core",
"@liveblocks/client",
"@liveblocks/react",
"@liveblocks/redux",
"@liveblocks/zustand",
"@liveblocks/node",
"@liveblocks/yjs",
"@liveblocks/react-ui",
"@liveblocks/react-lexical",
"@liveblocks/react-tiptap",
"@liveblocks/react-blocknote",
"@liveblocks/node-lexical",
"@liveblocks/node-prosemirror",
"@liveblocks/codemod",
"@liveblocks/emails",
]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"
- name: Install dependencies
run: npm install
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v4
with:
key: turbo-cache-${{ matrix.node-version }}-${{ matrix.pkg }}-bust3
path: node_modules/.cache/turbo
restore-keys:
turbo-cache-${{ matrix.node-version }}-${{ matrix.pkg }}-bust3
- name: Install Bun
uses: oven-sh/setup-bun@v1
- name: Build
run: npm run build -- --filter ${{ matrix.pkg }}
- name: Ensure no files are changed
run: |
CHANGED=$(git status --porcelain)
if [ -n "$CHANGED" ]; then
echo "Local, uncommitted changes found:"
echo "$CHANGED"
exit 1
fi
- name: Run unit tests
run: npm run test -- --filter ${{ matrix.pkg }} -- --coverage
- name: Run type tests
run: npm run test:types -- --filter ${{ matrix.pkg }}
- name: Run dependency tests
run: npm run test:deps -- --filter ${{ matrix.pkg }}
- name: Run lint checks
run: npm run lint -- --filter ${{ matrix.pkg }}
- name: Run public NPM packaging lint checks
run: npm run lint:package -- --filter ${{ matrix.pkg }}
e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.4.1]
timeout-minutes: 60
env:
LIVEBLOCKS_SECRET_KEY: ${{ secrets.E2E_TEST_LIVEBLOCKS_SECRET_KEY }}
NEXT_PUBLIC_GITHUB_SHA: ${{ github.sha }}
NEXT_PUBLIC_LIVEBLOCKS_BASE_URL: ${{ vars.E2E_TEST_LIVEBLOCKS_BASE_URL }}
NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY:
${{ secrets.E2E_TEST_LIVEBLOCKS_PUBLIC_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"
- name: Install dependencies
run: npm install
- name: Install Playwright
run: npx playwright install chromium
- name: Run Playwright tests
run: npm run test -- --filter @liveblocks/next-sandbox
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: e2e/next-sandbox/playwright-report
retention-days: 14
e2e-client-specs-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.4.1]
timeout-minutes: 60
env:
LIVEBLOCKS_PUBLIC_KEY: ${{ secrets.E2E_TEST_LIVEBLOCKS_PUBLIC_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: "**/package-lock.json"
- name: Run npm install
run: npm install
- name: Run e2e client specs tests
run: npm run test:e2e
working-directory: packages/liveblocks-core