-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create GitHub Capacitor Actions (#969)
- Loading branch information
Showing
1 changed file
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Capacitor | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
capacitor-android: | ||
name: android@${{ matrix.capacitor }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- jdk: 17 | ||
capacitor: latest | ||
node: 18.x | ||
- jdk: 11 | ||
capacitor: 4 | ||
node: 14.x | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: set up JDK ${{ matrix.jdk }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.jdk }} | ||
distribution: 'temurin' | ||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Build test app | ||
run: | | ||
mkdir temp | ||
cd temp | ||
mkdir www | ||
touch www/index.html | ||
npm init -y | ||
npm install .. | ||
npm install @capacitor/cli@${{ matrix.capacitor }} @capacitor/core@${{ matrix.capacitor }} @capacitor/android@${{ matrix.capacitor }} | ||
npx cap init test io.test.app | ||
npx cap add android | ||
npx cap sync android | ||
cd android | ||
chmod +x gradlew | ||
./gradlew build | ||
capacitor-ios: | ||
name: ios@${{ matrix.capacitor }} | ||
runs-on: macos-latest | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- capacitor: latest | ||
node: 18.x | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Build test app | ||
run: | | ||
mkdir temp | ||
cd temp | ||
mkdir www | ||
touch www/index.html | ||
npm init -y | ||
npm install .. | ||
npm install @capacitor/cli@${{ matrix.capacitor }} @capacitor/core@${{ matrix.capacitor }} @capacitor/ios@${{ matrix.capacitor }} | ||
npx cap init test io.test.app | ||
npx cap add ios | ||
npx cap sync ios | ||
cd ios | ||
xcodebuild -workspace App/App.xcworkspace -scheme CapacitorCordova -configuration Debug -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 14 Pro Max" |