Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
improved workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Aug 13, 2024
1 parent 18d27f1 commit e6c40aa
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 36 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/flutter-ci-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Flutter CI Pipeline

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
format:
uses: ./.github/workflows/flutter_format.yml

test:
uses: ./.github/workflows/flutter_test.yml

build:
needs: [format, test]
uses: ./.github/workflows/flutter_build.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
name: Flutter CI
name: Flutter Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:

jobs:
test:
name: Run Flutter tests and checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'

- name: Install dependencies
run: flutter pub get

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Analyze project source
run: flutter analyze

- name: Generate mocks
run: flutter pub run build_runner build --delete-conflicting-outputs

- name: Run unit tests
run: flutter test

build-android:
name: Build Android APK
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -55,7 +26,6 @@ jobs:

build-ios:
name: Build iOS IPA
needs: test
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/flutter_format.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Flutter Format

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_call:

jobs:
format:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Flutter Test

on:
workflow_call:

jobs:
test:
name: Run Flutter tests and checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'

- name: Install dependencies
run: flutter pub get

- name: Analyze project source
run: flutter analyze

- name: Generate mocks
run: flutter pub run build_runner build --delete-conflicting-outputs

- name: Run unit tests
run: flutter test

0 comments on commit e6c40aa

Please sign in to comment.