Skip to content

Use fvm and update flutter version to 3.22.2 #12

Use fvm and update flutter version to 3.22.2

Use fvm and update flutter version to 3.22.2 #12

Workflow file for this run

name: CI Checks
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
jobs:
full_CI:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Read FVM config
uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
cache: true
- name: Set up Melos
uses: bluefireteam/melos-action@v3
- name: Run analyzer
run: melos run analyze
- name: Check formatting of Dart files
run: melos run format_check
- name: Run unit tests
run: melos run test_unit
- name: Run golden tests
run: melos run test_golden
selective_CI:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read FVM config
uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
cache: true
- name: Set up Melos
uses: bluefireteam/melos-action@v3
- name: Set MELOS_PACKAGES filter with packages names that are affected by the Git Diff
run: |
changeAffectedPackages=$(melos list --diff=origin/main...HEAD --include-dependents)
if [[ $changeAffectedPackages == *"No package"* ]]; then
echo "MELOS_PACKAGES=dummy_value_to_filter_out_all_packages" >> $GITHUB_ENV
else
echo "MELOS_PACKAGES=$(echo "$changeAffectedPackages" | paste -sd ',' -)" >> $GITHUB_ENV
fi
- name: Print MELOS_PACKAGES global scope
run: |
echo "The Melos global scope is: $MELOS_PACKAGES"
echo "It'll be used as a global filter for the remaining Melos scripts in the pipeline!"
- name: Run analyzer with Git Diff using MELOS_PACKAGES
run: melos run analyze
- name: Check formatting of Dart files with Git Diff using MELOS_PACKAGES
run: melos run format_check
- name: Run unit tests with Git Diff using MELOS_PACKAGES
run: melos run test_unit
- name: Run golden tests with Git Diff using MELOS_PACKAGES
run: melos run test_golden
# This Melos filtering approach will not work as intended until the following
# feature is implemented https://github.com/invertase/melos/pull/702.
selective_CI_alternative:
if: false
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read FVM config
uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
cache: true
- name: Set up Melos
uses: bluefireteam/melos-action@v3
- name: Run analyzer with Git Diff
run: melos run analyze_diff
- name: Check formatting of Dart files with Git Diff
run: melos run format_check_diff
- name: Run unit tests with Git Diff
run: melos run test_unit_diff
- name: Run golden tests with Git Diff
run: melos run test_golden_diff