Skip to content

Commit

Permalink
Added Github Actions for Dart, Kotlin & Swift languages (#1616)
Browse files Browse the repository at this point in the history
* updated yml

* 🤖 Automated Format and Fix

* Revert "🤖 Automated Format and Fix"

This reverts commit 95407b6.

* updated yml

* added paths

* updated yml
  • Loading branch information
ygit committed Oct 31, 2023
1 parent 8a713cb commit 5296658
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
branches:
- main
- develop
paths:
- "**/*.dart"
paths-ignore:
- "**.md"
- doc/**
Expand All @@ -27,23 +29,42 @@ on:
- "**.txt"

jobs:
build_appbundle:
check_build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 12.x
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- name: Get Flutter dependencies in Core SDK
run: flutter pub get
working-directory: packages/hmssdk_flutter
- name: Dart Format
run: dart format .
- name: Dart Fix
run: cd packages/hmssdk_flutter; dart fix --apply
- name: Flutter Analyze in HMSSDK
uses: invertase/github-action-dart-analyzer@v1
with:
working-directory: packages/hmssdk_flutter
- name: Flutter Analyze in Room Kit
uses: invertase/github-action-dart-analyzer@v1
with:
working-directory: packages/hms_room_kit
- name: Commit and Push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 🤖 Automated Format and Fix
commit_user_name: 🤖 100ms Flutter Bot
- name: Build Android App Bundle
env:
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/ktlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: KtLint

on:
workflow_dispatch:
pull_request:
paths:
- "**/*.kt"

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions: read-all

jobs:
KtLint:
runs-on: ubuntu-latest

permissions:
checks: write

steps:
- name: Install ktlint
run: |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.44.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
- name: Run ktlint
run: |
ktlint --reporter=checkstyle,output=build/ktlint-report.xml
continue-on-error: true

- uses: yutailang0119/action-ktlint@v3
with:
report-path: build/*.xml
continue-on-error: false
27 changes: 27 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: SwiftLint

on:
workflow_dispatch:
pull_request:
paths:
- "**/*.swift"

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions: read-all

jobs:
SwiftLint:
runs-on: ubuntu-latest

permissions:
checks: write

steps:
- uses: actions/checkout@v4
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
env:
DIFF_BASE: ${{ github.base_ref }}

0 comments on commit 5296658

Please sign in to comment.