Skip to content

Commit

Permalink
Merge pull request #2579 from get10101/chore/remove-fvm
Browse files Browse the repository at this point in the history
chore(ci): Remove fvm
  • Loading branch information
holzeis authored May 29, 2024
2 parents 521070b + 5c9a2ec commit e21b9d3
Show file tree
Hide file tree
Showing 23 changed files with 157 additions and 205 deletions.
45 changes: 0 additions & 45 deletions .github/actions/setup-fvm/action.yml

This file was deleted.

9 changes: 6 additions & 3 deletions .github/workflows/android-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ jobs:
- name: List used Xcode version
run: /usr/bin/xcodebuild -version

- uses: ./.github/actions/setup-fvm
- uses: subosito/flutter-action@v2
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: flutter-${{ env.FLUTTER_VERSION }}
cache-path: ${{ runner.tool_cache }}/flutter

- name: Install just
run: cargo install just --force
Expand Down
33 changes: 19 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.22.1"

jobs:
formatting-dprint:
Expand All @@ -26,10 +27,13 @@ jobs:
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/[email protected]
- uses: ./.github/actions/setup-fvm
- uses: subosito/flutter-action@v2
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: flutter-${{ env.FLUTTER_VERSION }}
cache-path: ${{ runner.tool_cache }}/flutter
- name: Install FFI bindings
run: just deps-gen
- name: Generate FFI bindings
Expand Down Expand Up @@ -90,15 +94,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: extractions/setup-just@v1
- uses: ./.github/actions/setup-fvm
- uses: subosito/flutter-action@v2
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile

- uses: ./.github/actions/setup-fvm
with:
fvm_config: ./webapp/frontend/.fvmrc
working_dir: ./webapp/frontend
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: flutter-${{ env.FLUTTER_VERSION }}
cache-path: ${{ runner.tool_cache }}/flutter
- name: Download Dart mocks directory
uses: actions/download-artifact@v2
with:
Expand All @@ -125,10 +127,13 @@ jobs:
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/[email protected]
- uses: ./.github/actions/setup-fvm
- uses: subosito/flutter-action@v2
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: flutter-${{ env.FLUTTER_VERSION }}
cache-path: ${{ runner.tool_cache }}/flutter
- name: Download Rust generated FFI flutter bindings
uses: actions/download-artifact@v2
with:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
REGISTRY: ghcr.io
FLUTTER_VERSION: "3.22.1"

jobs:
docker:
Expand Down Expand Up @@ -62,10 +63,14 @@ jobs:
- uses: extractions/setup-just@v1
if: matrix.bin == 'webapp'

- uses: ./.github/actions/setup-fvm
- uses: subosito/flutter-action@v2
if: matrix.bin == 'webapp'
with:
fvm_config: ./webapp/frontend/.fvmrc
working_dir: ./webapp/frontend
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: flutter-${{ env.FLUTTER_VERSION }}
cache-path: ${{ runner.tool_cache }}/flutter

- name: build flutter for webapp
if: matrix.bin == 'webapp'
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/ios-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@ jobs:
- name: List used Xcode version
run: /usr/bin/xcodebuild -version

- uses: ./.github/actions/setup-fvm
- uses: subosito/flutter-action@v2
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: flutter-${{ env.FLUTTER_VERSION }}
cache-path: ${{ runner.tool_cache }}/flutter

- name: Check cocoapods version
run: /usr/local/bin/pod --version
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/testflight-for-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ jobs:
- name: List used Xcode version
run: /usr/bin/xcodebuild -version

- uses: ./.github/actions/setup-fvm
- uses: subosito/flutter-action@v2
with:
fvm_config: ./mobile/.fvmrc
working_dir: ./mobile
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: flutter-${{ env.FLUTTER_VERSION }}
cache-path: ${{ runner.tool_cache }}/flutter

- name: Check cocoapods version
run: /usr/local/bin/pod --version
Expand Down
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
To begin, ensure that you have a working installation of the following items:

- [Docker](https://docs.docker.com/) and docker-compose
- [Flutter Version Manager (FVM)](https://fvm.app/)
- [Rust language](https://rustup.rs/)
- Appropriate [Rust targets](https://rust-lang.github.io/rustup/cross-compilation.html) for cross-compiling to your device
- For Android targets:
Expand All @@ -28,18 +27,6 @@ echo "ANDROID_NDK=.." >> ~/.gradle/gradle.properties
- XCode
- Cocoapods

## FVM (Flutter Version Manager)

We use FVM to be able to easily switch between different Flutter versions.
Make sure to install it locally.
Once installed, you can use your favorite flutter commands as before, just add `fvm` before, e.g.

```bash
fvm flutter run
```

You can see whether you have all the sufficient dependencies for your platform by running `flutter doctor`.

## Contributing

We encourage community contributions whether it be a bug fix or an improvement to the documentation.
Expand Down
47 changes: 21 additions & 26 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,12 @@ deps-ios:
cargo install cargo-lipo
rustup target add aarch64-apple-ios x86_64-apple-ios

gen flutter_channel="":
gen:
#!/usr/bin/env bash
set -euxo pipefail
cd mobile
if [ -n "{{flutter_channel}}" ]; then
echo "Flutter channel is set to: {{flutter_channel}}"
fvm spawn {{flutter_channel}} pub get
else
echo "Flutter channel is default"
fvm flutter pub get
fi
flutter pub get

RUST_LOG={{ rust_log_for_frb }} flutter_rust_bridge_codegen \
--rust-input native/src/api.rs \
Expand All @@ -90,13 +84,13 @@ android-release:

# Build flutter webapp for cargo run --bin webapp
build-web args="":
cd webapp/frontend && fvm flutter build web {{args}}
cd webapp/frontend && flutter build web {{args}}

build-web-release:
cd webapp/frontend && fvm flutter build web --release
cd webapp/frontend && flutter build web --release

run-web:
cd webapp/frontend && fvm flutter run -d chrome --web-browser-flag "--disable-web-security"
cd webapp/frontend && flutter run -d chrome --web-browser-flag "--disable-web-security"

run-web-backend:
cargo run --bin web
Expand All @@ -115,7 +109,7 @@ ios-release:
run args="":
#!/usr/bin/env bash
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="REGTEST_FAUCET=http://localhost:8080" \
Expand All @@ -126,7 +120,7 @@ run args="":
run-regtest args="":
#!/usr/bin/env bash
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="ELECTRS_ENDPOINT={{public_regtest_electrs}}" \
Expand All @@ -140,7 +134,7 @@ run-regtest args="":
run-mainnet args="":
#!/usr/bin/env bash
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="ELECTRS_ENDPOINT=http://api.10101.finance:3000" \
Expand All @@ -155,7 +149,7 @@ run-mainnet args="":
run-regtest-android args="":
#!/usr/bin/env bash
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="ELECTRS_ENDPOINT={{public_regtest_electrs}}" \
Expand All @@ -172,7 +166,7 @@ run-local-android args="":
LOCAL_IP=$({{get_local_ip}})
echo "Android app will connect to $LOCAL_IP for 10101 services"
cd mobile && \
fvm flutter run {{args}} \
flutter run {{args}} \
--dart-define="COMMIT=$(git rev-parse HEAD)" \
--dart-define="BRANCH=$(git rev-parse --abbrev-ref HEAD)" \
--dart-define="ELECTRS_ENDPOINT=http://${LOCAL_IP}:3000" \
Expand All @@ -195,7 +189,7 @@ clean:
set -euxo pipefail
cd mobile
rm -rf mobile/android/app/src/main/jniLibs/*
fvm flutter clean
flutter clean
cd native && cargo clean
# Wipes everything
Expand Down Expand Up @@ -282,8 +276,8 @@ cargo-clippy:
cargo clippy --all-targets -- -D warnings

lint-flutter:
cd mobile && fvm flutter analyze --fatal-infos .
cd webapp/frontend && fvm flutter analyze --fatal-infos .
cd mobile && flutter analyze --fatal-infos .
cd webapp/frontend && flutter analyze --fatal-infos .

alias flutter-lint := lint-flutter

Expand Down Expand Up @@ -327,7 +321,8 @@ lnd-mock:
cargo run --package lnd-bridge --example mock

flutter-test:
cd mobile && fvm flutter pub run build_runner build --delete-conflicting-outputs && fvm flutter test
cd mobile && flutter pub get
cd mobile && flutter pub run build_runner build --delete-conflicting-outputs && flutter test

# Tests for the `native` crate
native-test:
Expand Down Expand Up @@ -520,7 +515,7 @@ build-ipa args="":
args+=(--flavor test)
fi

cd mobile && fvm flutter build ipa "${args[@]}" \
cd mobile && flutter build ipa "${args[@]}" \
--dart-define="ELECTRS_ENDPOINT=${ELECTRS_ENDPOINT}" \
--dart-define="COORDINATOR_P2P_ENDPOINT=${COORDINATOR_P2P_ENDPOINT}" \
--dart-define="NETWORK=${NETWORK}" \
Expand All @@ -547,15 +542,15 @@ publish-testflight-fastlane:
release-testflight: gen ios build-ipa publish-testflight

version:
cargo --version && rustc --version && fvm flutter --version
cargo --version && rustc --version && flutter --version

build-apk-regtest:
#!/usr/bin/env bash
BUILD_NAME=$(yq -r .version {{pubspec}})
BUILD_NUMBER=$(git rev-list HEAD --count)
echo "build name: ${BUILD_NAME}"
echo "build number: ${BUILD_NUMBER}"
cd mobile && fvm flutter build apk \
cd mobile && flutter build apk \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
Expand All @@ -577,7 +572,7 @@ build-app-bundle-regtest:
BUILD_NUMBER=$(git rev-list HEAD --count)
echo "build name: ${BUILD_NAME}"
echo "build number: ${BUILD_NUMBER}"
cd mobile && fvm flutter build appbundle \
cd mobile && flutter build appbundle \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
Expand Down Expand Up @@ -610,7 +605,7 @@ build-android-app-bundle:
os={{os()}}
echo "building on '$os' for '$NETWORK'"

cd mobile && fvm flutter build appbundle \
cd mobile && flutter build appbundle \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
Expand Down Expand Up @@ -643,7 +638,7 @@ build-android-app-apk args="":
os={{os()}}
echo "building on '$os' for '$NETWORK'"

cd mobile && fvm flutter build apk {{args}} \
cd mobile && flutter build apk {{args}} \
--build-name=${BUILD_NAME} \
--build-number=${BUILD_NUMBER} \
--release \
Expand Down
3 changes: 0 additions & 3 deletions mobile/.fvmrc

This file was deleted.

4 changes: 2 additions & 2 deletions mobile/lib/common/poll_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class _PollWidgetState extends State<PollWidget> {
},
style: ButtonStyle(
padding:
MaterialStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: MaterialStateProperty.all<Color>(Colors.white),
WidgetStateProperty.all<EdgeInsets>(const EdgeInsets.all(15)),
backgroundColor: WidgetStateProperty.all<Color>(Colors.white),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
Expand Down
Loading

0 comments on commit e21b9d3

Please sign in to comment.