Skip to content

Commit c048d8e

Browse files
committed
feat(ci): add musl CLI E2E test
Add cli-e2e-test-musl job that builds with musl target and runs directly on ubuntu-latest (musl binaries are statically linked). Includes full test parity with the glibc variant: vp check, global package install, CLI snapshot tests, upgrade, and implode.
1 parent 3a5fa16 commit c048d8e

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ jobs:
7474
include:
7575
- os: ubuntu-latest
7676
target: x86_64-unknown-linux-gnu
77+
- os: ubuntu-latest
78+
target: x86_64-unknown-linux-musl
7779
- os: windows-latest
7880
target: x86_64-pc-windows-msvc
7981
- os: macos-latest
@@ -96,19 +98,20 @@ jobs:
9698
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
9799
with:
98100
save-cache: ${{ github.ref_name == 'main' }}
99-
cache-key: test
101+
cache-key: test-${{ matrix.target }}
100102
target-dir: ${{ runner.os == 'Windows' && format('{0}/target', env.DEV_DRIVE) || '' }}
101103

102-
- run: rustup target add x86_64-unknown-linux-musl
103-
if: ${{ matrix.os == 'ubuntu-latest' }}
104+
- name: Add musl target
105+
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }}
106+
run: rustup target add x86_64-unknown-linux-musl
104107

105-
- run: cargo check --all-targets --all-features
108+
- run: cargo check --all-targets --all-features --target ${{ matrix.target }}
106109
env:
107110
RUSTFLAGS: '-D warnings --cfg tokio_unstable' # also update .cargo/config.toml
108111

109112
# Test all crates/* packages. New crates are automatically included.
110113
# Also test vite-plus-cli (lives outside crates/) to catch type sync issues.
111-
- run: cargo test $(for d in crates/*/; do echo -n "-p $(basename $d) "; done) -p vite-plus-cli
114+
- run: cargo test $(for d in crates/*/; do echo -n "-p $(basename $d) "; done) -p vite-plus-cli --target ${{ matrix.target }}
112115

113116
lint:
114117
needs: detect-changes
@@ -195,8 +198,13 @@ jobs:
195198
matrix:
196199
include:
197200
- os: ubuntu-latest
201+
target: x86_64-unknown-linux-gnu
202+
- os: ubuntu-latest
203+
target: x86_64-unknown-linux-musl
198204
- os: macos-latest
205+
target: aarch64-apple-darwin
199206
- os: windows-latest
207+
target: x86_64-pc-windows-msvc
200208
runs-on: ${{ matrix.os }}
201209
steps:
202210
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -215,7 +223,7 @@ jobs:
215223
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.0
216224
with:
217225
save-cache: ${{ github.ref_name == 'main' }}
218-
cache-key: cli-e2e-test
226+
cache-key: cli-e2e-test-${{ matrix.target }}
219227
target-dir: ${{ runner.os == 'Windows' && format('{0}/target', env.DEV_DRIVE) || '' }}
220228

221229
- uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4
@@ -232,10 +240,10 @@ jobs:
232240
- name: Build with upstream
233241
uses: ./.github/actions/build-upstream
234242
with:
235-
target: ${{ matrix.os == 'ubuntu-latest' && 'x86_64-unknown-linux-gnu' || matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || 'aarch64-apple-darwin' }}
243+
target: ${{ matrix.target }}
236244

237245
- name: Check TypeScript types
238-
if: ${{ matrix.os == 'ubuntu-latest' }}
246+
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
239247
run: pnpm tsgo
240248

241249
- name: Install Global CLI vp

0 commit comments

Comments
 (0)