Skip to content

Commit

Permalink
feat: Add CI github action
Browse files Browse the repository at this point in the history
Based on existing actions for our capacitor plugins

References: https://outsystemsrd.atlassian.net/browse/RMET-3980
  • Loading branch information
OS-pedrogustavobilro committed Jan 8, 2025
1 parent 8c7493c commit d172fcb
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/actions/setup-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Setup Tools'
description: 'Setup tools needed in repo'

runs:
using: 'composite'
steps:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 23
- name: Install dependencies
shell: bash
run: npm i
30 changes: 30 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
push:
branches: [ main, development ]
pull_request:
types: [opened, synchronize, reopened]

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:
needs: ['setup', 'lint', 'build']
runs-on: 'macos-15'
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- working-directory: ./packages/capacitor-plugin
run: npm install
- working-directory: ./packages/capacitor-plugin
run: npm run verify
21 changes: 21 additions & 0 deletions .github/workflows/reusable_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Build Plugin"

on:
workflow_call:
secrets:
THE_GH_RELEASE_TOKEN:
required: true

jobs:
build:
runs-on: 'ubuntu-24.04'
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

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

- name: 'Build Packages'
working-directory: ./packages/capacitor-plugin
run: npm run build
18 changes: 18 additions & 0 deletions .github/workflows/reusable_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Lint Plugin"

on:
workflow_call:

jobs:
lint:
runs-on: 'macos-15'
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

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

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

on:
workflow_call:

jobs:
setup:
strategy:
matrix:
os: ['ubuntu-24.04', 'macos-15']
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: 'Checkout code'
- uses: actions/checkout@v4

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

0 comments on commit d172fcb

Please sign in to comment.