diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 000000000..c300356c3 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "stable" +} \ No newline at end of file diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 247a23260..b2797beb2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,12 +21,17 @@ jobs: steps: - uses: actions/checkout@v4 - - - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.x' - channel: 'stable' - cache: true + + - name: Setup FVM + run: | + dart pub global activate fvm + echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH + + - name: Install Flutter with FVM + run: fvm install + + - name: Add FVM Flutter to PATH + run: echo "${{ github.workspace }}/.fvm/flutter_sdk/bin" >> $GITHUB_PATH - name: Install dependencies run: | diff --git a/.gitignore b/.gitignore index e1d08f94b..b28c5398d 100644 --- a/.gitignore +++ b/.gitignore @@ -79,4 +79,7 @@ packages/**/pubspec.lock !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 -/packages/*/coverage \ No newline at end of file +/packages/*/coverage + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/README.md b/README.md index 6da5f54d7..973d8ef44 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,19 @@ Flutter Client library for [Supabase](https://supabase.com/). This repo is a monorepo powered by [Melos](https://melos.invertase.dev/) containing [supabase_flutter](https://github.com/supabase/supabase-flutter/tree/main/packages/supabase_flutter) and its sub-libraries. All packages are located in the `packages` directory. +### Flutter SDK (FVM) + +This project uses [FVM](https://fvm.app/) to manage the Flutter SDK +version. Contributors should install FVM and use it when running Flutter +or Dart commands. + +Steps for contributors: + +- Install FVM (see https://fvm.app/) +- Install the project's Flutter SDK: `fvm install stable` +- Use the SDK in this repo: `fvm use stable` +- Run Flutter/Dart via FVM, e.g. `fvm flutter --version` + To install on a locally developed app: - Clone this repo @@ -38,7 +51,7 @@ Run the Dart tests within the package directory in `packages/` with the The `-j 1` flag runs the tests not concurrently, which works better since the tests are running against the same services. ```bash -dart test -j 1 +fvm dart test -j 1 ``` To stop the services run the following command in the `infra/` directory: diff --git a/melos.yaml b/melos.yaml index c34bbf4e8..11f0a3194 100644 --- a/melos.yaml +++ b/melos.yaml @@ -58,4 +58,4 @@ scripts: rm packages/yet_another_json_isolate/lib/src/version.dart # Stage the version.dart file change git add packages/*/lib/src/version.dart - \ No newline at end of file +sdkPath: .fvm/flutter_sdk