-
Notifications
You must be signed in to change notification settings - Fork 14
131 lines (128 loc) · 4.24 KB
/
ci.yml
File metadata and controls
131 lines (128 loc) · 4.24 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: "CI"
on:
pull_request:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [20]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run all
test-cordova:
name: Test (Cordova)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Setup environment
uses: ./
with:
legacy: true
install-pods: ${{ matrix.os == 'macos-latest' }}
- name: Verify CLI
run: |
cordova -v
ionic info || true
java -version
javac -version
- name: Build Android sample
run: |
ionic start testapp blank --cordova --type angular --no-link --no-git --no-interactive --confirm
cd testapp
ionic cordova platform add android@latest
ionic cordova build android
- name: Upload Android APK (Cordova)
uses: actions/upload-artifact@v6
with:
name: android-apk-cordova-${{ matrix.os }}
path: |
testapp/platforms/android/app/build/outputs/apk/**/*.apk
retention-days: 7
- name: Build iOS sample (macOS only)
if: ${{ matrix.os == 'macos-latest' }}
run: |
cd testapp
ionic cordova platform add ios@latest
# run the patch script from the repository root to adjust generated iOS files in CI
bash ../scripts/patch-ios.sh platforms/ios
# verify CocoaPods and ensure specs are up-to-date (redundant with script but safe)
pod --version || true
if [ -f platforms/ios/Podfile ]; then (cd platforms/ios && pod install --repo-update); fi
# build and instruct Cordova/Xcode to use the xcconfig the script creates
XCOV=$(pwd)/platforms/ios/xcconfigs/ci-overrides.xcconfig
ionic cordova build ios --no-interactive -- \
--buildFlag="-xcconfig ${XCOV}" \
--buildFlag="-sdk iphonesimulator" \
--buildFlag="-destination generic/platform=iOS Simulator"
test-capacitor:
name: Test (Capacitor)
runs-on: ${{ matrix.os }}
env:
CAPACITOR_ANDROID_STUDIO_PATH: /usr/bin/false
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Setup environment
uses: ./
with:
legacy: false
install-pods: ${{ matrix.os == 'macos-latest' }}
- name: Verify CLI
run: |
cap --version
ionic info || true
java -version
javac -version
- name: Build Android sample
run: |
ionic start testapp blank --type angular --no-link --no-git --no-interactive --confirm
cd testapp
ionic cap add android
ionic cap build android --no-open
- name: Inject Gradle Java 17 (non-Windows)
if: runner.os != 'Windows'
shell: bash
run: bash scripts/inject-gradle-java17.sh testapp
- name: Inject Gradle Java 17 (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: pwsh -File scripts/inject-gradle-java17.ps1 -AppPath testapp
- name: Upload Android APK (Capacitor)
uses: actions/upload-artifact@v6
with:
name: android-apk-${{ runner.os }}
path: |
testapp/android/app/build/outputs/apk/debug/*.apk
testapp\android\app\build\outputs\apk\debug\*.apk
retention-days: 7
- name: Build iOS sample (macOS only)
if: ${{ matrix.os == 'macos-latest' }}
run: |
cd testapp
ionic cap add ios
npx cap sync ios
xcodebuild -workspace ios/App/App.xcworkspace -scheme App -sdk iphonesimulator -configuration Debug build