-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: setup checks and tests workflows (#10)
- Loading branch information
Showing
62 changed files
with
1,472 additions
and
1,093 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,55 @@ | ||
name: ✅ Code Quality Checks | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
checks: | ||
name: 🔍 Code Quality and Formatting Verification | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- name: 📥 Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🛠️ Setup Flutter (Stable) | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
cache: true | ||
|
||
- name: 📦 Install All Package Dependencies | ||
run: dart ./scripts/pub_get.dart | ||
|
||
- name: 📦 Install Example Project Dependencies | ||
run: flutter pub get -C quill_native_bridge/example | ||
|
||
- name: 🎨 Perform Flutter Analysis | ||
run: flutter analyze --write=flutter_analyze.log | ||
|
||
- if: ${{ !cancelled() }} | ||
uses: yorifuji/flutter-analyze-commenter@v1 | ||
with: | ||
analyze-log: flutter_analyze.log | ||
verbose: false | ||
|
||
- name: 🔎 Validate Dart Code Formatting | ||
run: dart format --set-exit-if-changed . | ||
|
||
- name: 🔄 Preview Potential Dart Fixes | ||
run: dart fix --dry-run | ||
|
||
- name: 📦 Verify Package Readiness for Publishing | ||
run: dart ./scripts/publish_dry_run.dart | ||
|
||
# Ktlint: https://github.com/pinterest/ktlint | ||
- name: 🎨 Verify Kotlin Code Style with Ktlint | ||
uses: ScaCap/action-ktlint@master | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-review | ||
fail_on_error: true |
This file was deleted.
Oops, something went wrong.
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,52 @@ | ||
name: ✅ Swift Formatting Check | ||
|
||
# Separated from checks.yml since it takes longer to build swift-format from source | ||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- quill_native_bridge_ios/ios/quill_native_bridge_ios/**/*.swift | ||
- quill_native_bridge_macos/macos/quill_native_bridge_macos/**/*.swift | ||
- .github/workflows/swift-format-check.yml | ||
pull_request: | ||
paths: | ||
- quill_native_bridge_ios/ios/quill_native_bridge_ios/**/*.swift | ||
- quill_native_bridge_macos/macos/quill_native_bridge_macos/**/*.swift | ||
- .github/workflows/swift-format-check.yml | ||
|
||
jobs: | ||
format-check: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
env: | ||
SWIFT_FORMAT_VERSION: 600.0.0 | ||
|
||
steps: | ||
- name: 📥 Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🛠️ Setup Swift | ||
uses: swift-actions/setup-swift@v2 | ||
|
||
- name: 📦 Install Swift Format | ||
run: | | ||
git clone --branch $SWIFT_FORMAT_VERSION --depth 1 https://github.com/swiftlang/swift-format.git | ||
cd swift-format | ||
swift build -c release | ||
sudo mv .build/release/swift-format /usr/local/bin/ | ||
- name: 🔍 Verify Swift Format installation | ||
run: swift-format --version | ||
|
||
- name: ℹ️ Print the default configuration | ||
run: swift-format dump-configuration | ||
|
||
- name: 🔎 Validate Swift Code Formatting | ||
run: | | ||
swift-format lint -r quill_native_bridge_ios/ios/quill_native_bridge_ios --strict | ||
swift-format lint -r quill_native_bridge_macos/macos/quill_native_bridge_macos --strict | ||
# SwiftLint: https://github.com/realm/SwiftLint | ||
# - name: 🎨 Verify Swift Code Style with SwiftLint | ||
# uses: norio-nomura/[email protected] |
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,58 @@ | ||
name: 🧪 Run Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
desktop-tests: | ||
name: 🖥️ Desktop Tests (${{ matrix.os }} Latest) | ||
strategy: | ||
# This prevents one failure from stopping the entire run. | ||
fail-fast: false | ||
# TODO: Restore windows, run Android and iOS unit tests, cache swift-format | ||
matrix: | ||
os: [ubuntu, macos] | ||
runs-on: ${{ matrix.os }}-latest | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
- name: 📥 Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🛠️ Setup Flutter (Stable) | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
cache: true | ||
|
||
- name: 📦 Install all package dependencies | ||
run: dart ./scripts/pub_get.dart | ||
|
||
- name: 📦 Install example dependencies | ||
run: flutter pub get -C quill_native_bridge/example | ||
|
||
- name: 🧩 Run Flutter unit tests | ||
run: dart ./scripts/test.dart | ||
timeout-minutes: 5 | ||
|
||
- name: 📦 Install Linux dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa | ||
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev | ||
# For more details: https://docs.flutter.dev/testing/integration-tests#test-on-a-desktop-platform | ||
|
||
- name: 🧪 Run Flutter integration tests on Linux | ||
if: runner.os == 'Linux' | ||
uses: smithki/[email protected] | ||
with: | ||
run: flutter test integration_test -d linux -r github | ||
working-directory: quill_native_bridge/example | ||
|
||
- name: 🧪 Run Flutter integration tests on Non-Linux platforms | ||
if: runner.os != 'Linux' | ||
run: flutter test integration_test -d ${{ runner.os }} | ||
working-directory: quill_native_bridge/example |
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,26 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
analyzer: | ||
exclude: | ||
# Ignore generated files | ||
- '**/*.g.dart' | ||
- '**/*.mocks.dart' # Mockito @GenerateMocks (https://pub.dev/packages/mockito) | ||
|
||
linter: | ||
rules: | ||
- always_declare_return_types | ||
- avoid_escaping_inner_quotes | ||
- avoid_print | ||
- avoid_void_async | ||
- directives_ordering | ||
- prefer_final_fields | ||
- prefer_final_in_for_each | ||
- prefer_final_locals | ||
- prefer_relative_imports | ||
- prefer_single_quotes | ||
- unnecessary_parenthesis | ||
- avoid_web_libraries_in_flutter | ||
- prefer_const_constructors | ||
- prefer_const_constructors_in_immutables | ||
- prefer_const_declarations | ||
- avoid_slow_async_io |
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,10 @@ | ||
name: quill_native_bridge_workspace | ||
publish_to: 'none' | ||
|
||
environment: | ||
sdk: '>=3.0.0 <4.0.0' | ||
|
||
dev_dependencies: | ||
flutter_test: | ||
sdk: flutter | ||
flutter_lints: ^5.0.0 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,30 +1 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
linter: | ||
rules: | ||
always_declare_return_types: true | ||
always_put_required_named_parameters_first: true | ||
annotate_overrides: true | ||
avoid_empty_else: true | ||
avoid_escaping_inner_quotes: true | ||
avoid_print: true | ||
avoid_types_on_closure_parameters: true | ||
avoid_void_async: true | ||
directives_ordering: true | ||
omit_local_variable_types: true | ||
prefer_const_constructors: true | ||
prefer_const_constructors_in_immutables: true | ||
prefer_const_declarations: true | ||
prefer_final_fields: true | ||
prefer_final_in_for_each: true | ||
prefer_final_locals: true | ||
prefer_initializing_formals: true | ||
prefer_int_literals: true | ||
prefer_interpolation_to_compose_strings: true | ||
prefer_relative_imports: true | ||
prefer_single_quotes: true | ||
sort_constructors_first: true | ||
sort_unnamed_constructors_first: true | ||
unnecessary_lambdas: true | ||
unnecessary_parenthesis: true | ||
unnecessary_string_interpolations: true |
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
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
Oops, something went wrong.