Skip to content

Commit

Permalink
ci: use specific version of flutter (#156)
Browse files Browse the repository at this point in the history
Read the flutter version from `.fvmrc` and use that version of flutter
in ci jobs.
  • Loading branch information
poppingmoon authored May 13, 2024
1 parent 38b203b commit b28db8e
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ on:
workflow_dispatch:

jobs:
get-flutter-version:
runs-on: ubuntu-latest

outputs:
flutter-version: ${{ steps.get-flutter-version.outputs.version }}

steps:
- uses: actions/checkout@v4

- name: Get Flutter version from .fvmrc
id: get-flutter-version
run: >
echo version=$(grep flutter .fvmrc | cut -d ":" -f2|cut -d "\"" -f2)
>> $GITHUB_OUTPUT
format:
runs-on: ubuntu-latest

Expand All @@ -22,13 +37,16 @@ jobs:
analyze:
runs-on: ubuntu-latest

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Get dependencies
Expand All @@ -43,13 +61,16 @@ jobs:
test:
runs-on: ubuntu-latest

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Get dependencies
Expand All @@ -61,13 +82,16 @@ jobs:
integration-test-ios:
runs-on: macos-14

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Get dependencies
Expand All @@ -81,18 +105,24 @@ jobs:
- name: Pre-build the app
uses: nick-fields/retry@v3
with:
timeout_minutes: 60
max_attempts: 3
timeout_minutes: 30
max_attempts: 5
command: >
flutter build ios --simulator
--target=integration_test/timeline_test.dart
- name: Integration test
run: flutter test integration_test
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: flutter test integration_test

check-i18n-sorting:
runs-on: ubuntu-latest

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

Expand All @@ -107,6 +137,7 @@ jobs:
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Get dependencies
Expand All @@ -127,13 +158,16 @@ jobs:
check-build-diff:
runs-on: ubuntu-latest

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Run build_runner
Expand Down

0 comments on commit b28db8e

Please sign in to comment.