Skip to content

Commit

Permalink
chore: Move to package structure and introduce Melos (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
ABausG authored Jul 20, 2024
1 parent 284cd51 commit 9e86097
Show file tree
Hide file tree
Showing 135 changed files with 1,669 additions and 1,475 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/flutter-beta.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build Flutter Beta

on:
workflow_dispatch:
push:
branches:
- flutter-beta
Expand All @@ -15,20 +16,24 @@ concurrency:
jobs:
quality:
name: Quality Checks
runs-on: ubuntu-latest
runs-on: macos-14
defaults:
run:
working-directory: packages/home_widget

steps:
- uses: actions/checkout@v2

- uses: subosito/flutter-action@v1
with:
channel: beta
- name: Get Packages
run: flutter pub get
- uses: bluefireteam/melos-action@v3
- name: Analyze
run: flutter analyze
run: melos analyze
- name: Install Formatters
run: brew install swift-format ktfmt
- name: Format
run: dart format . --set-exit-if-changed
run: melos format:all
- name: Publishability
run: flutter pub publish --dry-run
- name: Test
Expand All @@ -45,18 +50,18 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: VeryGoodOpenSource/very_good_coverage@v1.2.0
path: ./packages/home_widget/coverage/lcov.info

android:
name: Android Integration Tests
needs: quality
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: beta
- uses: bluefireteam/melos-action@v3
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand All @@ -71,20 +76,22 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
working-directory: example
script: flutter test integration_test/android_test.dart -d emulator-5554
working-directory: packages/home_widget/example

# iOS Test based on https://medium.com/flutter-community/run-flutter-driver-tests-on-github-actions-13c639c7e4ab
# by @kate_sheremet
ios:
name: iOS Integration Tests
needs: quality
strategy:
matrix:
device:
- "iPhone 14"
fail-fast: false
runs-on: macos-14
defaults:
run:
working-directory: packages/home_widget/example
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
Expand All @@ -93,10 +100,10 @@ jobs:
- uses: subosito/flutter-action@v1
with:
channel: beta
- uses: bluefireteam/melos-action@v3
- uses: futureware-tech/simulator-action@v1
id: simulator
with:
model: ${{ matrix.device }}
- name: "Run iOS integration tests"
run: flutter test integration_test/ios_test.dart -d ${{steps.simulator.outputs.udid}}
working-directory: example
run: flutter test integration_test/ios_test.dart -d ${{steps.simulator.outputs.udid}}
29 changes: 18 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build

on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -17,20 +18,24 @@ concurrency:
jobs:
quality:
name: Quality Checks
runs-on: ubuntu-latest
runs-on: macos-14
defaults:
run:
working-directory: packages/home_widget

steps:
- uses: actions/checkout@v2

- uses: subosito/flutter-action@v1
with:
channel: stable
- name: Get Packages
run: flutter pub get
- uses: bluefireteam/melos-action@v3
- name: Analyze
run: flutter analyze
run: melos analyze
- name: Install Formatters
run: brew install swift-format ktfmt
- name: Format
run: dart format . --set-exit-if-changed
run: melos format:all
- name: Publishability
run: flutter pub publish --dry-run
- name: Test
Expand All @@ -47,18 +52,18 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: VeryGoodOpenSource/very_good_coverage@v1.2.0
path: ./packages/home_widget/coverage/lcov.info

android:
name: Android Integration Tests
needs: quality
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: stable
- uses: bluefireteam/melos-action@v3
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
Expand All @@ -73,20 +78,22 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
working-directory: example
script: flutter test integration_test/android_test.dart -d emulator-5554
working-directory: packages/home_widget/example

# iOS Test based on https://medium.com/flutter-community/run-flutter-driver-tests-on-github-actions-13c639c7e4ab
# by @kate_sheremet
ios:
name: iOS Integration Tests
needs: quality
strategy:
matrix:
device:
- "iPhone 14"
fail-fast: false
runs-on: macos-14
defaults:
run:
working-directory: packages/home_widget/example
steps:
- uses: actions/checkout@v2
- uses: maxim-lobanov/setup-xcode@v1
Expand All @@ -95,10 +102,10 @@ jobs:
- uses: subosito/flutter-action@v1
with:
channel: stable
- uses: bluefireteam/melos-action@v3
- uses: futureware-tech/simulator-action@v1
id: simulator
with:
model: ${{ matrix.device }}
- name: "Run iOS integration tests"
run: flutter test integration_test/ios_test.dart -d ${{steps.simulator.outputs.udid}}
working-directory: example
run: flutter test integration_test/ios_test.dart -d ${{steps.simulator.outputs.udid}}
Loading

0 comments on commit 9e86097

Please sign in to comment.