diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml new file mode 100644 index 000000000000..0853468a891f --- /dev/null +++ b/.github/workflows/cr.yml @@ -0,0 +1,46 @@ +name: CR + +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, labeled] + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number }} + cancel-in-progress: true + +jobs: + release: + if: github.repository == 'vitest-dev/vitest' && (github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'cr-tracked')) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Set node version to 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + cache: pnpm + + - name: Install + run: pnpm install --frozen-lockfile --prefer-offline + env: + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' + + - name: Build + run: pnpm build + env: + NO_VITE_TEST_WATCHER_DEBUG: '1' + + - name: Publish to StackBlitz + run: pnpx pkg-pr-new publish --compact --no-template --pnpm './packages/*' diff --git a/docs/guide/index.md b/docs/guide/index.md index 26c5197eb15a..21772b5eba45 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -287,7 +287,9 @@ Thanks for choosing Vitest! ## Using Unreleased Commits -If you can't wait for a new release to test the latest features, you will need to clone the [vitest repo](https://github.com/vitest-dev/vitest) to your local machine and then build and link it yourself ([pnpm](https://pnpm.io/) is required): +Each commit on main branch and a PR with a `cr-tracked` label are published to [pkg.pr.new](https://github.com/stackblitz-labs/pkg.pr.new). You can install it by `npm i https://pkg.pr.new/vitest@{commit}`. + +If you want to test your own modification locally, you can build and link it yourself ([pnpm](https://pnpm.io/) is required): ```bash git clone https://github.com/vitest-dev/vitest.git