Skip to content

feat: add migration guide for Rsbuild v2.0 (#433) #971

feat: add migration guide for Rsbuild v2.0 (#433)

feat: add migration guide for Rsbuild v2.0 (#433) #971

Workflow file for this run

name: CI
# PNPM setup based on https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CI: true
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
# Required for the Turborepo Git filters.
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: ">=24.0.0"
check-latest: true
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Restore Turborepo cache
id: cache-turborepo-restore
uses: actions/cache/restore@v5
with:
# Using SHA will usually provide cache hit on subsequent commits in a PR
# but will not provide cache hits between PRs, meaning the first run of a PR
# will usually only be cache misses.
key: ${{ runner.os }}-turbo-ci-v11-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-ci-v11-
${{ runner.os }}-turbo-v11-
path: .turbo
- name: Build packages
# For a PR, only build the packages that are diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm turbo run build --filter={./packages/*}...[${{ github.event.pull_request.base.sha }}]
else
pnpm build-pkg
fi
- name: Build webpack sample
# For a PR, only build the sample if it's diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm turbo run build --filter={./samples/webpack/*}...[${{ github.event.pull_request.base.sha }}]
else
pnpm build-webpack
fi
- name: Build Rsbuild sample
# For a PR, only build the sample if it's diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm turbo run build --filter={./samples/rsbuild/*}...[${{ github.event.pull_request.base.sha }}]
else
pnpm build-rsbuild
fi
- name: Build Storybook Rsbuild sample
# For a PR, only build the sample if it's diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm turbo run build --filter={./samples/storybook/rsbuild}...[${{ github.event.pull_request.base.sha }}]
else
pnpm build-storybook-rsbuild
fi
- name: Build Storybook Rslib sample
# For a PR, only build the sample if it's diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm turbo run build --filter={./samples/storybook/rslib}...[${{ github.event.pull_request.base.sha }}]
else
pnpm build-storybook-rslib
fi
- name: ESLint
# For a PR, only lint the projects that are diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm turbo run eslint --continue --filter=...[${{ github.event.pull_request.base.sha }}]
else
pnpm turbo run eslint --continue
fi
- name: Stylelint
# For a PR, only stylelint the projects that are diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm turbo run stylelint --continue --filter=...[${{ github.event.pull_request.base.sha }}]
else
pnpm turbo run stylelint --continue
fi
- name: Typecheck
# For a PR, only typecheck the projects that are diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm turbo run typecheck --continue --filter=...[${{ github.event.pull_request.base.sha }}]
else
pnpm turbo run typecheck --continue
fi
- name: Syncpack
run: pnpm turbo run syncpack
- name: Test packages
# For a PR, only test the projects that are diverging from the pull request original baseline.
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
pnpm test --filter=...[${{ github.event.pull_request.base.sha }}]
else
pnpm test
fi
- name: Save Turborepo cache
id: cache-turborepo-save
if: always() && steps.cache-turborepo-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
key: ${{ steps.cache-turborepo-restore.outputs.cache-primary-key }}
path: .turbo