Skip to content

Commit

Permalink
Improve CI workflows
Browse files Browse the repository at this point in the history
* ensure examples are being built on minimum supported SDK and latest stable SDK
* remove automatic formatter workflow, we ensure correct formatting on every PR and since formatting is Dart version dependent, this might not always work
* remove formatting/analyze steps from beta CI - same as above formatting and analysis should always use latest stable as baseline
  • Loading branch information
kuhnroyal committed May 17, 2024
1 parent e617b90 commit 97d75e7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 84 deletions.
38 changes: 6 additions & 32 deletions .github/workflows/flutter_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,12 @@ env:
FLUTTER_CHANNEL: 'beta'

jobs:
format:
name: "Check formatting"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- name: Lint analysis
run: flutter format --set-exit-if-changed .

lint:
name: "Static code analysis"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- name: Lint analysis
run: flutter analyze

build-android:
name: "Build Android apk"
runs-on: ubuntu-latest
defaults:
run:
working-directory: example

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -56,15 +28,18 @@ jobs:
- run: flutter pub get
- name: Build example APK
run: flutter build apk
# We might want to add a flutter test step in the future, when there actually are tests for this plugin
- name: Upload apk as artifact
uses: actions/upload-artifact@v4
with:
name: maplibre-flutter-demo.apk
path: example/build/app/outputs/flutter-apk/app-release.apk

build-iOS:
name: Build iOS package
runs-on: macos-latest
defaults:
run:
working-directory: example

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand All @@ -80,7 +55,7 @@ jobs:
- name: Upload Runner.app as artifact
uses: actions/upload-artifact@v4
with:
name: Runner.app
name: maplibre-flutter-demo.app
path: example/build/ios/iphonesimulator

build-web:
Expand All @@ -89,7 +64,6 @@ jobs:
defaults:
run:
working-directory: example

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Expand Down
50 changes: 26 additions & 24 deletions .github/workflows/flutter_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,25 @@ name: Flutter CI

on: [push, pull_request, workflow_dispatch]

env:
FLUTTER_CHANNEL: 'stable'
FLUTTER_VERSION: '3.10.5'

jobs:
format:
name: "Check formatting"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- name: Lint analysis
run: dart format --set-exit-if-changed .

lint:
name: "Static code analysis"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- run: |
Expand All @@ -46,37 +36,46 @@ jobs:
defaults:
run:
working-directory: example

strategy:
fail-fast: false
matrix:
sdk: [ '3.10.5', '' ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.sdk }}
cache: true
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- run: flutter pub get
- name: Build example APK
run: flutter build apk
# We might want to add a flutter test step in the future, when there actually are tests for this plugin
- name: Upload apk as artifact
uses: actions/upload-artifact@v4
if: ${{ matrix.sdk == '' }}
with:
name: maplibre-flutter-demo.apk
path: example/build/app/outputs/flutter-apk/app-release.apk

build-iOS:
name: Build iOS package
runs-on: macos-latest
defaults:
run:
working-directory: example

strategy:
fail-fast: false
matrix:
sdk: [ '3.10.5', '' ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ matrix.sdk }}
cache: true
- uses: maxim-lobanov/setup-cocoapods@v1
with:
Expand All @@ -85,9 +84,10 @@ jobs:
- name: Build iOS package
run: flutter build ios --simulator
- name: Upload Runner.app as artifact
if: ${{ matrix.sdk == '' }}
uses: actions/upload-artifact@v4
with:
name: Runner.app
name: maplibre-flutter-demo.app
path: example/build/ios/iphonesimulator

build-web:
Expand All @@ -96,13 +96,15 @@ jobs:
defaults:
run:
working-directory: example

strategy:
fail-fast: false
matrix:
sdk: [ '3.10.5', '' ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
flutter-version: ${{ matrix.sdk }}
cache: true
- run: flutter pub get
- name: Build web
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/formatter.yml

This file was deleted.

0 comments on commit 97d75e7

Please sign in to comment.