|
| 1 | +name: Windows Tests (Flutter) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "main" |
| 7 | + - "release/*" |
| 8 | + paths: |
| 9 | + - ".github/workflows/flutter_ci.yaml" |
| 10 | + - ".github/actions/flutter_build/**" |
| 11 | + - "frontend/rust-lib/**" |
| 12 | + - "frontend/appflowy_flutter/**" |
| 13 | + - "frontend/resources/**" |
| 14 | + |
| 15 | + pull_request: |
| 16 | + branches: |
| 17 | + - "main" |
| 18 | + - "release/*" |
| 19 | + paths: |
| 20 | + - ".github/workflows/flutter_ci.yaml" |
| 21 | + - ".github/actions/flutter_build/**" |
| 22 | + - "frontend/rust-lib/**" |
| 23 | + - "frontend/appflowy_flutter/**" |
| 24 | + - "frontend/resources/**" |
| 25 | + |
| 26 | +env: |
| 27 | + CARGO_TERM_COLOR: always |
| 28 | + FLUTTER_VERSION: "3.27.4" |
| 29 | + RUST_TOOLCHAIN: "1.81.0" |
| 30 | + CARGO_MAKE_VERSION: "0.37.18" |
| 31 | + CLOUD_VERSION: 0.6.54-amd64 |
| 32 | + |
| 33 | +concurrency: |
| 34 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 35 | + cancel-in-progress: true |
| 36 | + |
| 37 | +jobs: |
| 38 | + windows_tests: |
| 39 | + strategy: |
| 40 | + fail-fast: false |
| 41 | + matrix: |
| 42 | + os: [windows-latest] |
| 43 | + include: |
| 44 | + - os: windows-latest |
| 45 | + flutter_profile: development-windows-x86 |
| 46 | + target: x86_64-pc-windows-msvc |
| 47 | + |
| 48 | + runs-on: ${{ matrix.os }} |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Checkout source code |
| 52 | + uses: actions/checkout@v4 |
| 53 | + |
| 54 | + - name: Install Rust toolchain |
| 55 | + id: rust_toolchain |
| 56 | + uses: actions-rs/toolchain@v1 |
| 57 | + with: |
| 58 | + toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 59 | + target: ${{ matrix.target }} |
| 60 | + override: true |
| 61 | + profile: minimal |
| 62 | + |
| 63 | + - name: Install flutter |
| 64 | + id: flutter |
| 65 | + uses: subosito/flutter-action@v2 |
| 66 | + with: |
| 67 | + channel: "stable" |
| 68 | + flutter-version: ${{ env.FLUTTER_VERSION }} |
| 69 | + cache: true |
| 70 | + |
| 71 | + - uses: Swatinem/rust-cache@v2 |
| 72 | + with: |
| 73 | + prefix-key: ${{ matrix.os }} |
| 74 | + workspaces: | |
| 75 | + frontend/rust-lib |
| 76 | + cache-all-crates: true |
| 77 | + |
| 78 | + - uses: taiki-e/install-action@v2 |
| 79 | + with: |
| 80 | + tool: cargo-make@${{ env.CARGO_MAKE_VERSION }}, duckscript_cli |
| 81 | + |
| 82 | + - name: Install prerequisites |
| 83 | + working-directory: frontend |
| 84 | + shell: bash |
| 85 | + run: | |
| 86 | + vcpkg integrate install |
| 87 | + vcpkg update |
| 88 | + cargo make appflowy-flutter-deps-tools |
| 89 | +
|
| 90 | + - name: Build AppFlowy |
| 91 | + working-directory: frontend |
| 92 | + run: cargo make --profile ${{ matrix.flutter_profile }} appflowy-core-dev |
| 93 | + shell: bash |
| 94 | + |
| 95 | + - name: Run code generation |
| 96 | + working-directory: frontend |
| 97 | + run: cargo make code_generation |
| 98 | + shell: bash |
| 99 | + |
| 100 | + - name: Flutter Analyzer |
| 101 | + working-directory: frontend/appflowy_flutter |
| 102 | + run: flutter analyze . |
| 103 | + shell: bash |
| 104 | + |
| 105 | + - name: Run Flutter unit tests |
| 106 | + env: |
| 107 | + DISABLE_EVENT_LOG: true |
| 108 | + DISABLE_CI_TEST_LOG: "true" |
| 109 | + working-directory: frontend |
| 110 | + run: cargo make dart_unit_test_no_build |
| 111 | + shell: bash |
| 112 | + |
| 113 | + - name: Run Flutter integration tests |
| 114 | + working-directory: frontend |
| 115 | + run: flutter test integration_test/runner.dart -d Windows --coverage |
| 116 | + shell: bash |
0 commit comments