Skip to content

fix(changesets): remove generated sdk from workspace #452

fix(changesets): remove generated sdk from workspace

fix(changesets): remove generated sdk from workspace #452

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
# Make pnpm available before setup-node uses cache: 'pnpm'
- name: Enable Corepack (pnpm)
run: |
corepack enable
corepack prepare pnpm@9.12.2 --activate
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run format check
run: pnpm format
test:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: quality
strategy:
matrix:
node-version: [20, 22]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
# Make pnpm available before setup-node uses cache: 'pnpm'
- name: Enable Corepack (pnpm)
run: |
corepack enable
corepack prepare pnpm@9.12.2 --activate
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
# Fast Java (no apt-get)
- name: Setup Java (JDK 17)
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
# Cache Firebase emulators (JARs) once
- name: Cache Firebase emulators
if: matrix.node-version == '20'
uses: actions/cache@v4
with:
path: |
~/.cache/firebase/emulators
~/.cache/firebase/runtime
key: ${{ runner.os }}-firebase-emulators-${{ hashFiles('firebase.json', '.firebaserc', 'package.json', 'pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-firebase-emulators-
# Ensure pnpm has a global bin dir on Linux runners (fixes ERR_PNPM_NO_GLOBAL_BIN_DIR)
- name: Configure PNPM global bin
if: matrix.node-version == '20'
run: |
echo "PNPM_HOME=$HOME/.local/share/pnpm" >> $GITHUB_ENV
mkdir -p "$HOME/.local/share/pnpm"
echo "$HOME/.local/share/pnpm" >> $GITHUB_PATH
# Install Firebase CLI globally so pnpm test:emulator works
- name: Install Firebase CLI (global, fast)
if: matrix.node-version == '20'
run: pnpm add -g firebase-tools@14
# Optional turbo cache
- name: Cache turbo build metadata
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm turbo build
- name: Verify build outputs
run: |
MISSING_BUILDS=""
for PKG_DIR in packages/*; do
if [ -d "$PKG_DIR" ] && [ -f "$PKG_DIR/package.json" ]; then
PKG_NAME=$(basename "$PKG_DIR")
if [ ! -d "$PKG_DIR/dist" ]; then
MISSING_BUILDS="$MISSING_BUILDS $PKG_NAME"
fi
fi
done
if [ -n "$MISSING_BUILDS" ]; then
echo "❌ Build outputs not found for: $MISSING_BUILDS"
exit 1
fi
echo "✅ All build outputs verified"
# Run emulator tests only once (Node 20)
- name: Run tests with emulator
if: matrix.node-version == '20'
run: pnpm test:emulator