-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.82 KB
/
wrapper-js-ci.yml
File metadata and controls
71 lines (60 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# CI workflow for JavaScript-based wrapper SDKs (Cordova-Ionic/React Native)
# Sets up JDK, Clang, and either Bun or Vite+ (vp), then runs lint and tests
name: Wrapper JS CI
on:
workflow_call:
inputs:
java_version:
required: false
type: string
description: Java version to use
default: "17"
toolchain:
required: false
type: string
description: Toolchain to use for install, lint & test ("bun" or "vite-plus")
default: bun
bun_version:
required: false
type: string
description: Bun version to use (only when toolchain is "bun")
default: latest
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java_version }}
distribution: "temurin"
- name: Setup Clang
uses: OneSignal/actions/.github/actions/setup-clang@main
- name: Set up Bun
if: inputs.toolchain == 'bun'
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ inputs.bun_version }}
- name: Install (Bun)
if: inputs.toolchain == 'bun'
run: bun install --frozen-lockfile
- name: Set up Vite+
if: inputs.toolchain == 'vite-plus'
uses: voidzero-dev/setup-vp@v1
with:
cache: true
run-install: true
- name: Linting (Bun)
if: inputs.toolchain == 'bun'
run: bun run lint
- name: Linting (Vite+)
if: inputs.toolchain == 'vite-plus'
run: vp run lint
- name: Tests (Bun)
if: inputs.toolchain == 'bun'
run: bun run test:coverage
- name: Tests (Vite+)
if: inputs.toolchain == 'vite-plus'
run: vp run test