-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge branch 'upstream/main' into feat/file-progress
- Loading branch information
Showing
47 changed files
with
970 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Mobile-CI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "Branch to build" | ||
required: true | ||
default: "main" | ||
workflow_id: | ||
description: "Codemagic workflow ID" | ||
required: true | ||
default: "ios-workflow" | ||
type: choice | ||
options: | ||
- ios-workflow | ||
- android-workflow | ||
|
||
env: | ||
CODEMAGIC_API_TOKEN: ${{ secrets.CODEMAGIC_API_TOKEN }} | ||
APP_ID: "6731d2f427e7c816080c3674" | ||
|
||
jobs: | ||
trigger-mobile-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Trigger Codemagic Build | ||
id: trigger_build | ||
run: | | ||
RESPONSE=$(curl -X POST \ | ||
--header "Content-Type: application/json" \ | ||
--header "x-auth-token: $CODEMAGIC_API_TOKEN" \ | ||
--data '{ | ||
"appId": "${{ env.APP_ID }}", | ||
"workflowId": "${{ github.event.inputs.workflow_id }}", | ||
"branch": "${{ github.event.inputs.branch }}" | ||
}' \ | ||
https://api.codemagic.io/builds) | ||
BUILD_ID=$(echo $RESPONSE | jq -r '.buildId') | ||
echo "build_id=$BUILD_ID" >> $GITHUB_OUTPUT | ||
echo "build_id=$BUILD_ID" | ||
- name: Wait for build and check status | ||
id: check_status | ||
run: | | ||
while true; do | ||
RESPONSE=$(curl -X GET \ | ||
--header "Content-Type: application/json" \ | ||
--header "x-auth-token: $CODEMAGIC_API_TOKEN" \ | ||
https://api.codemagic.io/builds/${{ steps.trigger_build.outputs.build_id }}) | ||
STATUS=$(echo $RESPONSE | jq -r '.build.status') | ||
if [ "$STATUS" = "finished" ]; then | ||
SUCCESS=$(echo $RESPONSE | jq -r '.success') | ||
BUILD_URL=$(echo $RESPONSE | jq -r '.buildUrl') | ||
echo "status=$STATUS" >> $GITHUB_OUTPUT | ||
echo "success=$SUCCESS" >> $GITHUB_OUTPUT | ||
echo "build_url=$BUILD_URL" >> $GITHUB_OUTPUT | ||
break | ||
elif [ "$STATUS" = "failed" ]; then | ||
echo "status=failed" >> $GITHUB_OUTPUT | ||
break | ||
fi | ||
sleep 60 | ||
done | ||
- name: Slack Notification | ||
uses: 8398a7/action-slack@v3 | ||
if: always() | ||
with: | ||
status: ${{ steps.check_status.outputs.success == 'true' && 'success' || 'failure' }} | ||
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took | ||
text: | | ||
Mobile CI Build Result | ||
Branch: ${{ github.event.inputs.branch }} | ||
Workflow: ${{ github.event.inputs.workflow_id }} | ||
Build URL: ${{ steps.check_status.outputs.build_url }} | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.RELEASE_SLACK_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
workflows: | ||
ios-workflow: | ||
name: iOS Workflow | ||
instance_type: mac_mini_m2 | ||
max_build_duration: 30 | ||
environment: | ||
flutter: 3.22.3 | ||
xcode: latest | ||
cocoapods: default | ||
|
||
scripts: | ||
- name: Build Flutter | ||
script: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
source "$HOME/.cargo/env" | ||
rustc --version | ||
cargo --version | ||
cd frontend | ||
rustup target install aarch64-apple-ios-sim | ||
cargo install --force cargo-make | ||
cargo install --force duckscript_cli | ||
cargo install --force cargo-lipo | ||
cargo make appflowy-flutter-deps-tools | ||
cargo make --profile development-ios-arm64-sim appflowy-core-dev-ios | ||
cargo make --profile development-ios-arm64-sim code_generation | ||
- name: iOS integration tests | ||
script: | | ||
cd frontend/appflowy_flutter | ||
flutter emulators --launch apple_ios_simulator | ||
flutter -d iPhone test integration_test/runner.dart | ||
artifacts: | ||
- build/ios/ipa/*.ipa | ||
- /tmp/xcodebuild_logs/*.log | ||
- flutter_drive.log | ||
|
||
publishing: | ||
email: | ||
recipients: | ||
- lucas.xu@appflowy.io | ||
notify: | ||
success: true | ||
failure: true |
47 changes: 47 additions & 0 deletions
47
frontend/appflowy_flutter/integration_test/desktop/document/document_block_option_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import 'package:appflowy_editor/appflowy_editor.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:integration_test/integration_test.dart'; | ||
|
||
import '../../shared/util.dart'; | ||
|
||
void main() { | ||
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); | ||
|
||
group('Block option interaction tests', () { | ||
testWidgets('has correct block selection on tap option button', | ||
(tester) async { | ||
await tester.initializeAppFlowy(); | ||
await tester.tapAnonymousSignInButton(); | ||
|
||
// We edit the document by entering some characters, to ensure the document has focus | ||
await tester.editor.updateSelection( | ||
Selection.collapsed(Position(path: [2])), | ||
); | ||
|
||
// Insert character 'a' three times - easy to identify | ||
await tester.ime.insertText('aaa'); | ||
await tester.pumpAndSettle(); | ||
|
||
final editorState = tester.editor.getCurrentEditorState(); | ||
final node = editorState.getNodeAtPath([2]); | ||
expect(node?.delta?.toPlainText(), startsWith('aaa')); | ||
|
||
final multiSelection = Selection( | ||
start: Position(path: [2], offset: 3), | ||
end: Position(path: [4], offset: 40), | ||
); | ||
|
||
// Select multiple items | ||
await tester.editor.updateSelection(multiSelection); | ||
await tester.pumpAndSettle(); | ||
|
||
// Press the block option menu | ||
await tester.editor.hoverAndClickOptionMenuButton([2]); | ||
await tester.pumpAndSettle(); | ||
|
||
// Expect the selection to be Block type and not have changed | ||
expect(editorState.selectionType, SelectionType.block); | ||
expect(editorState.selection, multiSelection); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.