Skip to content

Commit 0b09691

Browse files
authored
Merge branch 'main' into ignore-flaky-test
2 parents 7d10fb0 + 109fca0 commit 0b09691

11 files changed

Lines changed: 497 additions & 280 deletions

File tree

.github/workflows/ci.yml

Lines changed: 109 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ jobs:
253253
- name: Run vp check
254254
run: vp check
255255

256+
- name: Run unit tests
257+
run: RUST_BACKTRACE=1 pnpm test:unit
258+
env:
259+
RUST_MIN_STACK: 8388608
260+
256261
- name: Test global package install (powershell)
257262
if: ${{ matrix.os == 'windows-latest' }}
258263
shell: pwsh
@@ -384,21 +389,6 @@ jobs:
384389
vp env use --unset
385390
node --version
386391
387-
- name: Install Playwright browsers
388-
run: pnpx playwright install chromium
389-
390-
- name: Run CLI snapshot tests
391-
run: |
392-
RUST_BACKTRACE=1 pnpm test
393-
if ! git diff --quiet; then
394-
echo "::error::Snapshot diff detected. Run 'pnpm -F vite-plus snap-test' locally and commit the updated snap.txt files."
395-
git diff --stat
396-
git diff
397-
exit 1
398-
fi
399-
env:
400-
RUST_MIN_STACK: 8388608
401-
402392
# Upgrade tests (merged from separate job to avoid duplicate build)
403393
- name: Test upgrade (bash)
404394
shell: bash
@@ -572,6 +562,109 @@ jobs:
572562
pnpm bootstrap-cli:ci
573563
vp --version
574564
565+
cli-snap-test:
566+
name: CLI snap test (${{ matrix.target }}, ${{ matrix.shard }}/${{ matrix.shardTotal }})
567+
needs:
568+
- download-previous-rolldown-binaries
569+
strategy:
570+
fail-fast: false
571+
matrix:
572+
include:
573+
- os: namespace-profile-linux-x64-default
574+
target: x86_64-unknown-linux-gnu
575+
shard: 1
576+
shardTotal: 3
577+
- os: namespace-profile-linux-x64-default
578+
target: x86_64-unknown-linux-gnu
579+
shard: 2
580+
shardTotal: 3
581+
- os: namespace-profile-linux-x64-default
582+
target: x86_64-unknown-linux-gnu
583+
shard: 3
584+
shardTotal: 3
585+
- os: namespace-profile-mac-default
586+
target: aarch64-apple-darwin
587+
shard: 1
588+
shardTotal: 3
589+
- os: namespace-profile-mac-default
590+
target: aarch64-apple-darwin
591+
shard: 2
592+
shardTotal: 3
593+
- os: namespace-profile-mac-default
594+
target: aarch64-apple-darwin
595+
shard: 3
596+
shardTotal: 3
597+
- os: windows-latest
598+
target: x86_64-pc-windows-msvc
599+
shard: 1
600+
shardTotal: 3
601+
- os: windows-latest
602+
target: x86_64-pc-windows-msvc
603+
shard: 2
604+
shardTotal: 3
605+
- os: windows-latest
606+
target: x86_64-pc-windows-msvc
607+
shard: 3
608+
shardTotal: 3
609+
runs-on: ${{ matrix.os }}
610+
steps:
611+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
612+
- uses: ./.github/actions/clone
613+
614+
- name: Setup Dev Drive
615+
if: runner.os == 'Windows'
616+
uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
617+
with:
618+
drive-size: 12GB
619+
drive-format: ReFS
620+
env-mapping: |
621+
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
622+
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
623+
624+
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
625+
with:
626+
save-cache: ${{ github.ref_name == 'main' }}
627+
cache-key: cli-snap-test-${{ matrix.target }}
628+
target-dir: ${{ runner.os == 'Windows' && format('{0}/target', env.DEV_DRIVE) || '' }}
629+
630+
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
631+
632+
- name: Install docs dependencies
633+
run: pnpm -C docs install --frozen-lockfile
634+
635+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
636+
with:
637+
name: rolldown-binaries
638+
path: ./rolldown/packages/rolldown/src
639+
merge-multiple: true
640+
641+
- name: Build with upstream
642+
uses: ./.github/actions/build-upstream
643+
with:
644+
target: ${{ matrix.target }}
645+
646+
- name: Install Global CLI vp
647+
run: |
648+
pnpm bootstrap-cli:ci
649+
if [[ "$RUNNER_OS" == "Windows" ]]; then
650+
echo "$USERPROFILE\.vite-plus\bin" >> $GITHUB_PATH
651+
else
652+
echo "$HOME/.vite-plus/bin" >> $GITHUB_PATH
653+
fi
654+
655+
- name: Run CLI snapshot tests (shard ${{ matrix.shard }}/${{ matrix.shardTotal }})
656+
run: |
657+
RUST_BACKTRACE=1 pnpm -F ./packages/cli snap-test-local --shard=${{ matrix.shard }}/${{ matrix.shardTotal }}
658+
RUST_BACKTRACE=1 pnpm -F ./packages/cli snap-test-global --shard=${{ matrix.shard }}/${{ matrix.shardTotal }}
659+
if ! git diff --quiet; then
660+
echo "::error::Snapshot diff detected. Run 'pnpm -F vite-plus snap-test' locally and commit the updated snap.txt files."
661+
git diff --stat
662+
git diff
663+
exit 1
664+
fi
665+
env:
666+
RUST_MIN_STACK: 8388608
667+
575668
cli-e2e-test-musl:
576669
name: CLI E2E test (Linux x64 musl)
577670
needs:
@@ -731,6 +824,7 @@ jobs:
731824
- lint
732825
- cli-e2e-test
733826
- cli-e2e-test-musl
827+
- cli-snap-test
734828
steps:
735829
- run: exit 1
736830
# Thank you, next https://github.com/vercel/next.js/blob/canary/.github/workflows/build_and_test.yml#L379

Cargo.lock

Lines changed: 87 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/vite_global_cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ path = "src/main.rs"
1515
base64-simd = { workspace = true }
1616
chrono = { workspace = true }
1717
clap = { workspace = true, features = ["derive"] }
18-
clap_complete = { workspace = true }
18+
clap_complete = { workspace = true, features = ["unstable-dynamic"] }
1919
directories = { workspace = true }
2020
flate2 = { workspace = true }
2121
serde = { workspace = true }

0 commit comments

Comments
 (0)