Skip to content

Commit dce965b

Browse files
authored
feat: support Alpine Linux containers (#22)
## Summary - Fall back to `sh` when `bash` is not available, enabling Alpine Linux support without requiring bash as a prerequisite - Add "Alpine Container" usage example to README - Add `test-alpine-container` CI job testing both `latest` and `alpha` versions in Alpine 3.21 container ## Test plan - [ ] `test-alpine-container` CI job passes for both vp versions - [ ] `vp --version` and `vp exec` work inside Alpine container - [ ] Existing tests on ubuntu/macos/windows still pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: MK (fengmk2) <[email protected]>
1 parent da9fe67 commit dce965b

File tree

4 files changed

+52
-11
lines changed

4 files changed

+52
-11
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,33 @@ jobs:
231231
run: |
232232
echo "NODE_AUTH_TOKEN is set: ${NODE_AUTH_TOKEN:+yes}"
233233
234+
test-alpine-container:
235+
strategy:
236+
fail-fast: false
237+
matrix:
238+
version: [latest, alpha]
239+
runs-on: ubuntu-latest
240+
container:
241+
image: alpine:3.21
242+
steps:
243+
- name: Install Alpine dependencies
244+
run: apk add --no-cache bash curl gcompat libstdc++
245+
246+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
247+
248+
- name: Setup Vite+ (${{ matrix.version }})
249+
uses: ./
250+
with:
251+
version: ${{ matrix.version }}
252+
run-install: false
253+
cache: false
254+
255+
- name: Verify installation
256+
run: vp --version
257+
258+
- name: Verify vp exec works
259+
run: vp exec node -e "console.log('vp exec works in Alpine')"
260+
234261
build:
235262
runs-on: ubuntu-latest
236263
steps:

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,22 @@ steps:
110110
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
111111
```
112112

113+
### Alpine Container
114+
115+
Alpine Linux uses musl libc instead of glibc. Install compatibility packages before using the action:
116+
117+
```yaml
118+
jobs:
119+
build:
120+
runs-on: ubuntu-latest
121+
container:
122+
image: alpine:3.21
123+
steps:
124+
- run: apk add --no-cache bash curl gcompat libstdc++
125+
- uses: actions/checkout@v6
126+
- uses: voidzero-dev/setup-vp@v1
127+
```
128+
113129
### Matrix Testing with Multiple Node.js Versions
114130

115131
```yaml

0 commit comments

Comments
 (0)