Skip to content

Commit

Permalink
Create GitHub Capacitor Actions (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
peitschie authored May 6, 2023
1 parent 9c29e21 commit 47e8f09
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/capacitor.yaml
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"

0 comments on commit 47e8f09

Please sign in to comment.