Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/prepare-example-app/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Prepare Example app'
description: 'Does necessary pre-work for the example app to compile natively'

runs:
using: 'composite'
steps:
- name: 'Build plugin'
shell: bash
run: npm run build
- name: 'Install example app dependencies'
working-directory: ./example-app
shell: bash
run: npm i
- name: 'Build Web example app'
working-directory: ./example-app
shell: bash
run: npm run build
- name: 'Sync example app native platforms'
working-directory: ./example-app
shell: bash
run: npx cap sync
17 changes: 17 additions & 0 deletions .github/actions/setup-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Setup Tools'
description: 'Setup tools needed in repo'

runs:
using: 'composite'
steps:
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 22
# Ensure npm 11.5.1 or later is installed for Trusted publishing
- name: Update npm
shell: bash
run: npm install -g npm@latest
- name: Install dependencies
shell: bash
run: npm i
45 changes: 45 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Continuous Integrations"

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
- next
- development
- '*.x'

jobs:
setup:
uses: ./.github/workflows/reusable_setup.yml

lint:
needs: 'setup'
uses: ./.github/workflows/reusable_lint.yml

build:
needs: 'setup'
uses: ./.github/workflows/reusable_build.yml

verify-plugin-android:
needs: ['setup', 'lint', 'build']
runs-on: 'macos-15'
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- name: 'Setup Tools'
uses: ./.github/actions/setup-tools
- name: 'Verify Android'
run: npm run verify:android

verify-plugin-ios:
needs: ['setup', 'lint', 'build']
runs-on: 'macos-15'
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- name: 'Setup Tools'
uses: ./.github/actions/setup-tools
- name: 'Verify iOS'
run: npm run verify:ios
33 changes: 33 additions & 0 deletions .github/workflows/reusable_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Build Plugin"

on:
workflow_call:
secrets:
THE_GH_RELEASE_TOKEN:
required: false

jobs:
build:
runs-on: "ubuntu-24.04"
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }}

- name: "Setup Tools"
uses: ./.github/actions/setup-tools

- name: "Copy README.md in root"
run: cp README.md README.md.original

- name: "Build Packages"
run: npm run build

- name: "Check README.md changes"
run: |
if ! cmp --silent README.md README.md.original; then
echo "Detected README.md changes; Do 'npm run build' to update the docs."
exit 1
fi
22 changes: 22 additions & 0 deletions .github/workflows/reusable_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Lint Plugin"

on:
workflow_call:
secrets:
THE_GH_RELEASE_TOKEN:
required: false

jobs:
lint:
runs-on: 'macos-15'
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
with:
token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }}

- name: 'Setup Tools'
uses: ./.github/actions/setup-tools

- name: 'Lint Packages'
run: npm run lint
22 changes: 22 additions & 0 deletions .github/workflows/reusable_setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Setup"

on:
workflow_call:
secrets:
THE_GH_RELEASE_TOKEN:
required: false

jobs:
setup:
strategy:
matrix:
os: ['ubuntu-24.04', 'macos-15']
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
with:
token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }}

- name: 'Setup Tools'
uses: ./.github/actions/setup-tools
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock=false
provenance=true
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@ionic/eslint-config": "^0.4.0",
"@ionic/prettier-config": "^4.0.0",
"@ionic/swiftlint-config": "^2.0.0",
"@types/node": "^24.10.1",
"eslint": "^8.57.1",
"prettier": "^3.6.2",
"prettier-plugin-java": "^2.7.7",
Expand Down
Loading