name: ci-rsc permissions: {} on: workflow_dispatch: push: branches: - main pull_request: paths: - 'packages/plugin-rsc/**' - 'pnpm-lock.yaml' - '.github/workflows/ci-rsc.yml' schedule: # Run daily at 00:00 UTC to catch upstream changes in React canary/experimental. # Those move without any change in this repo, so the nightly runs only the React entries. - cron: '0 0 * * *' concurrency: group: ${{ github.workflow }}-${{ github.event.number || github.sha }} cancel-in-progress: true jobs: test: # the nightly only tests newer React versions if: github.event_name != 'schedule' runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 - run: pnpm i - run: pnpm build - run: pnpm -C packages/plugin-rsc tsc - run: pnpm -C packages/plugin-rsc test test-e2e: name: test-rsc (${{ matrix.os }} / ${{ matrix.browser }}) ${{ matrix.vite && format('(vite-{0})', matrix.vite) || '' }} ${{ matrix.react_version && format('(react-{0})', matrix.react_version) || '' }} ${{ matrix.subset && format('(subset-{0})', matrix.subset) || '' }} ${{ matrix.shard && format('(shard-{0}/{1})', matrix.shard, matrix.shards) || '' }} runs-on: ${{ matrix.os }} strategy: # Entries other than Linux chromium run a subset of tests (see `E2E_SUBSET` in playwright.config.ts). matrix: include: >- ${{ fromJSON(github.event_name == 'schedule' && '[ { "os": "ubuntu-latest", "browser": "chromium", "react_version": "canary" }, { "os": "ubuntu-latest", "browser": "chromium", "react_version": "experimental" } ]' || '[ { "os": "ubuntu-latest", "browser": "chromium", "shard": 1, "shards": 2 }, { "os": "ubuntu-latest", "browser": "chromium", "shard": 2, "shards": 2 }, { "os": "windows-latest", "browser": "chromium", "subset": "os" }, { "os": "macos-latest", "browser": "chromium", "subset": "os" }, { "os": "ubuntu-latest", "browser": "firefox", "subset": "browser" }, { "os": "ubuntu-latest", "browser": "webkit", "subset": "browser" }, { "os": "ubuntu-latest", "browser": "chromium", "vite": "7", "shard": 1, "shards": 2 }, { "os": "ubuntu-latest", "browser": "chromium", "vite": "7", "shard": 2, "shards": 2 }, { "os": "ubuntu-latest", "browser": "chromium", "react_version": "experimental", "shard": 1, "shards": 2 }, { "os": "ubuntu-latest", "browser": "chromium", "react_version": "experimental", "shard": 2, "shards": 2 } ]') }} fail-fast: false steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version: 24 - run: pnpm i - name: install react if: ${{ matrix.react_version }} run: | ./scripts/override-react.sh "$REACT_VERSION" pnpm i --no-frozen-lockfile env: REACT_VERSION: ${{ matrix.react_version }} - run: pnpm build - name: install vite ${{ matrix.vite }} if: ${{ matrix.vite }} run: | yq -i '.overrides.vite = "^${{ matrix.vite }}"' pnpm-workspace.yaml yq -i '.overrides."@vitejs/plugin-react" = "^5"' pnpm-workspace.yaml yq -i '.packages += ["!packages/plugin-react"]' pnpm-workspace.yaml pnpm i --no-frozen-lockfile # webkit on Linux needs system libraries that the runner image doesn't ship - run: pnpm -C packages/plugin-rsc exec playwright install ${WITH_DEPS:+--with-deps} "$BROWSER_NAME" shell: bash env: BROWSER_NAME: ${{ matrix.browser }} WITH_DEPS: ${{ runner.os == 'Linux' && matrix.browser == 'webkit' && 'true' || '' }} - run: pnpm -C packages/plugin-rsc test-e2e-ci --project="$BROWSER_NAME" ${SHARD:+--shard="$SHARD/$SHARDS"} shell: bash env: BROWSER_NAME: ${{ matrix.browser }} E2E_SUBSET: ${{ matrix.subset }} SHARD: ${{ matrix.shard }} SHARDS: ${{ matrix.shards }} - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 if: always() with: name: test-results-${{ matrix.os }}-${{ matrix.browser }}${{ matrix.vite && format('-vite-{0}', matrix.vite) || '' }}${{ matrix.react_version && format('-react-{0}', matrix.react_version) || '' }}${{ matrix.shard && format('-shard-{0}', matrix.shard) || '' }} path: | packages/plugin-rsc/test-results if-no-files-found: ignore