ci: fix upper latest supported Flutter SDK version (#255) #323
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
# Runs flutter test and CHANGELOG.md validation on every PR to main. | |
# Failed goldens are uploaded and can be seen in the artifact summary of the job. | |
name: Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
# Ensure that new pushes/updates cancel running jobs | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: 3.27.x | |
cache: true | |
- name: Flutter doctor | |
run: flutter doctor -v | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Run Flutter test | |
id: test | |
run: flutter test | |
- name: Upload goldens if tests fail. | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() && steps.test.conclusion == 'failure' }} | |
with: | |
name: goldens | |
path: test/failures/ | |
retention-days: 3 | |
changelog-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone Repository. | |
uses: actions/checkout@v4 | |
- name: Read Changelog and validate. | |
uses: mindsers/[email protected] | |
with: | |
validation_level: "error" | |
build-android: | |
name: "Build Android apk" | |
runs-on: ubuntu-latest | |
needs: [test, changelog-test] | |
defaults: | |
run: | |
working-directory: example | |
strategy: | |
fail-fast: false | |
matrix: | |
sdk: ["3.22.3", "3.27.x"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
cache: "gradle" | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: ${{ matrix.sdk }} | |
cache: true | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build appbundle. | |
run: flutter build appbundle --profile --no-pub | |
build-iOS: | |
name: Build iOS package | |
runs-on: macos-latest | |
needs: [test, changelog-test] | |
defaults: | |
run: | |
working-directory: example | |
strategy: | |
fail-fast: false | |
matrix: | |
sdk: ["3.22.3", "3.27.x"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: ${{ matrix.sdk }} | |
cache: true | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build iOS package | |
run: flutter build ios --no-codesign |