Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ui): migrate from golden_toolkit -> alchemist #2070

Merged
merged 18 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/update_goldens.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: update_goldens

on: workflow_dispatch

jobs:
update_goldens:
runs-on: ubuntu-latest
steps:
- name: 🚫 Ensure branch is not master
if: ${{ github.event.inputs.branch == 'master' || github.event.inputs.branch == 'origin/master'}}
run: |
echo "Updating goldens on 'master' branch is prohibited."
exit 1

- name: 📚 Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

- name: 🐦 Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.x"
channel: stable
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}

- name: 📦 Install Tools
run: flutter pub global activate melos

- name: 🔧 Bootstrap Workspace
run: melos bootstrap --verbose

- name: 🖼️ Update Goldens
working-directory: packages/stream_chat_flutter
continue-on-error: true
run: |
flutter test --tags golden --update-goldens

- name: 📤 Commit Changes
id: commit_changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Update Goldens"
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
136 changes: 98 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,58 +1,118 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
.project
.classpath
.settings

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# VS Code related
.vscode/
**/lcov.info
coverage

# Flutter/Dart/Pub related
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
.dart_tool/
build/
coverage/
coverage_helper_test.dart
**/doc/api/
pubspec.lock
pubspec_overrides.yaml
flutter_export_environment.sh
generated_plugin_registrant.*
GeneratedPluginRegistrant.*

examples/all_plugins/pubspec.yaml
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

Podfile
# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
Podfile.lock
Pods/
.symlinks/
**/Flutter/App.framework/
**/Flutter/ephemeral/
**/Flutter/Flutter.framework/
**/Flutter/Generated.xcconfig
**/Flutter/flutter_assets/

ServiceDefinitions.json
xcuserdata/
**/DerivedData/

local.properties
keystore.properties

# Exceptions to iOS rules
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3

# Generated files
*.dart.js
*.info.json
*.js
*.js_
*.js.deps
*.js.map
**/lcov.info

# Other ignored files
google-services.json
.melos_tool/
.packages/flutter_widgets/example/ios/Flutter/.last_build_id
.packages/dart_client/example/ios/Flutter/.last_build_id
.packages/dart_client/example/ios/Runner.xcodeproj/project.pbxproj

# Ignore FVM
**/.fvm

# Gradle related
.gradle/
gradlew
gradlew.bat
gradle-wrapper.jar
.flutter-plugins-dependencies
*.iml

generated_plugin_registrant.dart
GeneratedPluginRegistrant.h
GeneratedPluginRegistrant.m
GeneratedPluginRegistrant.java
GeneratedPluginRegistrant.swift
build/
.flutter-plugins

.project
.classpath
.settings
**/.fvm

.melos_tool/
/packages/flutter_widgets/example/ios/Flutter/.last_build_id
/packages/dart_client/example/ios/Flutter/.last_build_id
/packages/dart_client/example/ios/Runner.xcodeproj/project.pbxproj
# Non-CI golden files and failures
**/test/**/goldens/**/*.*
**/test/**/failures/**/*.*
!**/test/**/goldens/ci/*.*

# Exceptions to the above rules
!/pubspec.lock
!**/example/web/sql-wasm.js
!**/example/web/sql-wasm.wasm
6 changes: 5 additions & 1 deletion melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ packages:

command:
bootstrap:
# It seems so that running "pub get" in parallel has some issues (like
# https://github.com/dart-lang/pub/issues/3404). Disabling this feature
# makes the CI much more stable.
runPubGetInParallel: false
# Dart and Flutter environment used in the project.
environment:
sdk: ^3.5.4
Expand Down Expand Up @@ -72,12 +76,12 @@ command:

# List of all the dev_dependencies used in the project.
dev_dependencies:
alchemist: ^0.11.0
build_runner: ^2.4.9
drift_dev: ^2.22.1
fake_async: ^1.3.1
faker_dart: ^0.2.1
freezed: ^2.4.2
golden_toolkit: ^0.15.0
json_serializable: ^6.7.1
mocktail: ^1.0.0
path: ^1.8.3
Expand Down
68 changes: 0 additions & 68 deletions packages/stream_chat_flutter/.gitignore

This file was deleted.

44 changes: 44 additions & 0 deletions packages/stream_chat_flutter/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# target 'RunnerTests' do
# inherit! :search_paths
# end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
Loading
Loading