Skip to content

Commit

Permalink
Add runDartCommand and runFlutterCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsreichardt committed Dec 15, 2023
1 parent 038a292 commit aeae9f6
Show file tree
Hide file tree
Showing 24 changed files with 107 additions and 268 deletions.
44 changes: 4 additions & 40 deletions .github/workflows/alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,9 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Activate sz_repo_cli package
run: fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
run: flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"

# So we can just use "sz COMMAND" instead of "dart ../path/to/script.dart ..."
- run: echo $(realpath ./bin) >> $GITHUB_PATH
Expand Down Expand Up @@ -114,15 +105,6 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Install Codemagic CLI Tools
run: pip3 install codemagic-cli-tools==0.47.0
Expand Down Expand Up @@ -176,7 +158,7 @@ jobs:
# because they easier to install. App Bundles are installed via the
# PlayStore which resulted in problems in the past.
fvm flutter build apk \
flutter build apk \
--release \
--flavor prod \
--target=lib/main_prod.dart \
Expand Down Expand Up @@ -222,18 +204,9 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Activate sz_repo_cli package
run: fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
run: flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"

# So we can just use "sz COMMAND" instead of "dart ../path/to/script.dart ..."
- run: echo $(pwd)/bin >> $GITHUB_PATH
Expand Down Expand Up @@ -289,19 +262,10 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Install Sharezone Repo CLI
run: |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(realpath ./bin) >> $GITHUB_PATH
- name: Deploy macOS to TestFlight
Expand Down
44 changes: 4 additions & 40 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,10 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Install Sharezone Repo CLI
run: |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(pwd)/bin >> $GITHUB_PATH
- name: Deploy
Expand Down Expand Up @@ -125,19 +116,10 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Install Sharezone Repo CLI
run: |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(pwd)/bin >> $GITHUB_PATH
- name: Install Firebase CLI
Expand Down Expand Up @@ -186,22 +168,13 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Install Fastlane
run: sudo gem install fastlane -v 2.216.0

- name: Install Sharezone Repo CLI
run: |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(pwd)/bin >> $GITHUB_PATH
- name: Deploy
Expand Down Expand Up @@ -239,19 +212,10 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Install Sharezone Repo CLI
run: |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(pwd)/bin >> $GITHUB_PATH
- name: Deploy to TestFlight
Expand Down
22 changes: 2 additions & 20 deletions .github/workflows/cli_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,9 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Activate sz_repo_cli package
run: fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
run: flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"

# So we can just use "sz COMMAND" instead of "dart ../path/to/script.dart ..."
- run: echo $(realpath ./bin) >> $GITHUB_PATH
Expand Down Expand Up @@ -141,18 +132,9 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Activate sz_repo_cli package
run: fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
run: flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"

# So we can just use "sz COMMAND" instead of "dart ../path/to/script.dart ..."
- run: echo $(pwd)/bin >> $GITHUB_PATH
Expand Down
22 changes: 2 additions & 20 deletions .github/workflows/integration_tests_app_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,6 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

# Because macos-12 doesn't have Metal support, we need to disable Impeller
# https://github.com/flutter/flutter/issues/126768
Expand Down Expand Up @@ -224,7 +215,7 @@ jobs:
# using not the default flavor will cause an exception when
# uninstalling the app, see:
# https://github.com/flutter/flutter/issues/88690
fvm flutter drive \
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/integration_test_old.dart \
--flavor prod \
Expand All @@ -247,15 +238,6 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Install chromedriver
uses: nanasess/setup-chromedriver@480d644e773cd6d53e4cb76557c8ad5e5806d7da
Expand All @@ -269,7 +251,7 @@ jobs:
# available for the web yet.
run: |
chromedriver --port=4444 &
fvm flutter drive \
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/integration_test_old.dart \
--flavor dev \
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/licence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,18 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Activate license_checker
run: fvm dart pub global activate license_checker 1.6.0
run: dart pub global activate license_checker 1.6.0

- name: Check licenses in app
run: |
cd app
fvm flutter pub get
flutter pub get
lic_ck check-licenses --config ../licenses_config.yaml --problematic
- name: Check licenses in sz cli
run: |
cd tools/sz_repo_cli
fvm dart pub get
dart pub get
lic_ck check-licenses --config ../../licenses_config.yaml --problematic
33 changes: 3 additions & 30 deletions .github/workflows/safe_app_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,9 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Activate sz_repo_cli package
run: fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
run: flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"

# So we can just use "sz COMMAND" instead of "dart ../path/to/script.dart ..."
- run: echo $(realpath ./bin) >> $GITHUB_PATH
Expand Down Expand Up @@ -156,18 +147,9 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Activate sz_repo_cli package
run: fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
run: flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"

# So we can just use "sz COMMAND" instead of "dart ../path/to/script.dart ..."
- run: echo $(pwd)/bin >> $GITHUB_PATH
Expand All @@ -194,19 +176,10 @@ jobs:
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
# Use format expected by FVM.
# Else this won't be recognized as an installed version when setting
# '.../flutter' as the FVM Flutter version cache folder.
cache-path: "${{ runner.tool_cache }}/flutter/:version:"

- name: Install FVM
run: |
flutter pub global activate fvm 2.4.1
fvm config --cache-path '${{ runner.tool_cache }}/flutter'

- name: Install Sharezone CLI
run: |
fvm flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
flutter pub global activate --source path "$CI_CD_DART_SCRIPTS_PACKAGE_PATH"
echo $(pwd)/bin >> $GITHUB_PATH
- name: Run code generation via "sz build_runner build"
Expand Down
Loading

0 comments on commit aeae9f6

Please sign in to comment.