11# CI workflow for JavaScript-based wrapper SDKs (Cordova-Ionic/React Native)
2- # Sets up JDK, Homebrew, Clang, Bun, then runs lint and tests
2+ # Sets up JDK, Clang, and either Bun or Vite+ (vp) , then runs lint and tests
33name : Wrapper JS CI
44
55on :
1010 type : string
1111 description : Java version to use
1212 default : " 17"
13+ toolchain :
14+ required : false
15+ type : string
16+ description : Toolchain to use for install, lint & test ("bun" or "vite-plus")
17+ default : bun
1318 bun_version :
1419 required : false
1520 type : string
16- description : Bun version to use
21+ description : Bun version to use (only when toolchain is "bun")
1722 default : latest
1823
1924jobs :
2025 ci :
2126 runs-on : ubuntu-latest
2227 steps :
2328 - name : Checkout
24- uses : actions/checkout@v5
29+ uses : actions/checkout@v6
2530
26- - name : Set up JDK 17
31+ - name : Set up JDK
2732 uses : actions/setup-java@v4
2833 with :
2934 java-version : ${{ inputs.java_version }}
@@ -33,15 +38,34 @@ jobs:
3338 uses : OneSignal/actions/.github/actions/setup-clang@main
3439
3540 - name : Set up Bun
41+ if : inputs.toolchain == 'bun'
3642 uses : oven-sh/setup-bun@v2
3743 with :
3844 bun-version : ${{ inputs.bun_version }}
3945
40- - name : Install
46+ - name : Install (Bun)
47+ if : inputs.toolchain == 'bun'
4148 run : bun install --frozen-lockfile
4249
43- - name : Linting
50+ - name : Set up Vite+
51+ if : inputs.toolchain == 'vite-plus'
52+ uses : voidzero-dev/setup-vp@v1
53+ with :
54+ cache : true
55+ run-install : true
56+
57+ - name : Linting (Bun)
58+ if : inputs.toolchain == 'bun'
4459 run : bun run lint
4560
46- - name : Tests
61+ - name : Linting (Vite+)
62+ if : inputs.toolchain == 'vite-plus'
63+ run : vp run lint
64+
65+ - name : Tests (Bun)
66+ if : inputs.toolchain == 'bun'
4767 run : bun run test:coverage
68+
69+ - name : Tests (Vite+)
70+ if : inputs.toolchain == 'vite-plus'
71+ run : vp run test
0 commit comments