Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
ci: use linux vm for dart unit test (#3991)
Richard Shiuec475a5d960c5
diff --git a/.github/workflows/flutter_ci.yaml b/.github/workflows/flutter_ci.yamlindex b64a51a00e..8e15ba9779 100644--- a/.github/workflows/flutter_ci.yaml+++ b/.github/workflows/flutter_ci.yaml@@ -108,18 +108,15 @@ jobs:- name: Build AppFlowyworking-directory: frontend- run: |- cargo make --profile ${{ matrix.flutter_profile }} appflowy-core-dev+ run: cargo make --profile ${{ matrix.flutter_profile }} appflowy-core-dev- name: Run code generationworking-directory: frontend- run: |- cargo make code_generation+ run: cargo make code_generation- name: Flutter Analyzerworking-directory: frontend/appflowy_flutter- run: |- flutter analyze .+ run: flutter analyze .- name: Compress appflowy_flutterrun: tar -czf appflowy_flutter.tar.gz frontend/appflowy_flutter@@ -135,11 +132,11 @@ jobs:strategy:fail-fast: falsematrix:- os: [macos-latest]+ os: [ubuntu-latest]include:- - os: macos-latest- flutter_profile: development-mac-x86_64- target: x86_64-apple-darwin+ - os: ubuntu-latest+ flutter_profile: development-linux-x86_64+ target: x86_64-unknown-linux-gnuruns-on: ${{ matrix.os }}steps:@@ -176,19 +173,45 @@ jobs:- name: Install prerequisitesworking-directory: frontendrun: |- if [ "$RUNNER_OS" == "macOS" ]; then- cargo make appflowy-flutter-deps-tools+ if [ "$RUNNER_OS" == "Linux" ]; then+ sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub+ sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list+ sudo apt-get update+ sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-devfishell: bash+ - name: Enable Flutter Desktop+ run: |+ if [ "$RUNNER_OS" == "Linux" ]; then+ flutter config --enable-linux-desktop+ elif [ "$RUNNER_OS" == "macOS" ]; then+ flutter config --enable-macos-desktop+ elif [ "$RUNNER_OS" == "Windows" ]; then+ git config --system core.longpaths true+ flutter config --enable-windows-desktop+ fi+ shell: bash++ - uses: actions/download-artifact@v3+ with:+ name: ${{ github.run_id }}-${{ matrix.os }}++ - name: Uncompress appflowy_flutter+ run: tar -xf appflowy_flutter.tar.gz++ - name: Run flutter pub get+ working-directory: frontend+ run: cargo make pub_get+- name: Run Flutter unit testsworking-directory: frontendrun: |if [ "$RUNNER_OS" == "macOS" ]; then- flutter config --enable-macos-desktop- cargo make --profile ${{ matrix.flutter_profile }} appflowy-devcargo make dart_unit_test- else+ elif [ "$RUNNER_OS" == "Linux" ]; then+ cargo make dart_unit_test_no_build+ elif [ "$RUNNER_OS" == "Windows" ]; thencargo make dart_unit_test_no_buildfishell: bash@@ -213,7 +236,7 @@ jobs:strategy:fail-fast: falsematrix:- os: [ubuntu-latest,windows-latest]+ os: [ubuntu-latest, windows-latest]include:- os: ubuntu-latestflutter_profile: development-linux-x86_64@@ -277,10 +300,9 @@ jobs:- name: Uncompress appflowy_flutterrun: tar -xf appflowy_flutter.tar.gz- - name: Run code generation+ - name: Run flutter pub getworking-directory: frontend- run: |- cargo make code_generation+ run: cargo make pub_get- name: Run Flutter integration testsworking-directory: frontend/appflowy_flutter@@ -384,12 +406,6 @@ jobs:- name: Uncompress appflowy_flutterrun: tar -xf appflowy_flutter.tar.gz- - name: Run code generation- if: matrix.os == 'windows-latest'- working-directory: frontend- run: |- cargo make code_generation-- name: Build flutter productworking-directory: frontendrun: |diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.tomlindex df57636baf..3ccac1f58f 100644--- a/frontend/scripts/makefile/flutter.toml+++ b/frontend/scripts/makefile/flutter.toml@@ -263,25 +263,33 @@ script = []script_runner = "@duckscript"-[tasks.code_generation]+[tasks.pub_get]script_runner = "@shell"script = ["""cd appflowy_flutterflutter cleanflutter pub get- flutter packages pub getcd ../- sh scripts/code_generation/generate.sh"""]-[tasks.code_generation.windows]+[tasks.pub_get.windows]script_runner = "@duckscript"script = ["""cd ./appflowy_flutter/exec cmd.exe /c flutter cleanexec cmd.exe /c flutter pub get- exec cmd.exe /c flutter packages pub getcd ../+ """]++[tasks.code_generation]+script_runner = "@shell"+script = ["""+ sh scripts/code_generation/generate.sh+ """]++[tasks.code_generation.windows]+script_runner = "@duckscript"+script = ["""exec scripts/code_generation/generate.cmd"""]