Skip to content

Commit b6da597

Browse files
committed
chore: enable integration test on windows and linux
1 parent 7ed36f8 commit b6da597

File tree

3 files changed

+93
-11
lines changed

3 files changed

+93
-11
lines changed

.github/actions/flutter_build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ runs:
9898

9999
- uses: actions/upload-artifact@v4
100100
with:
101-
name: ${{ github.run_id }}-${{ matrix.os }}
101+
name: ${{ github.run_id }}-${{ inputs.os }}
102102
path: appflowy_flutter.tar.gz

.github/actions/flutter_integration_test/action.yml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,59 @@ runs:
4949
- name: Install prerequisites
5050
working-directory: frontend
5151
run: |
52-
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
53-
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
54-
sudo apt-get update
55-
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-dev network-manager
52+
if [ "$RUNNER_OS" == "Linux" ]; then
53+
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
54+
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
55+
sudo apt-get update
56+
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev keybinder-3.0 libnotify-dev network-manager
57+
elif [ "$RUNNER_OS" == "Windows" ]; then
58+
vcpkg integrate install
59+
elif [ "$RUNNER_OS" == "macOS" ]; then
60+
echo 'do nothing'
61+
fi
5662
shell: bash
5763

5864
- name: Enable Flutter Desktop
5965
run: |
60-
flutter config --enable-linux-desktop
66+
if [ "$RUNNER_OS" == "Linux" ]; then
67+
flutter config --enable-linux-desktop
68+
elif [ "$RUNNER_OS" == "Windows" ]; then
69+
flutter config --enable-windows-desktop
70+
elif [ "$RUNNER_OS" == "macOS" ]; then
71+
flutter config --enable-macos-desktop
72+
fi
6173
shell: bash
6274

6375
- uses: actions/download-artifact@v4
76+
if: ${{ inputs.RUNNER_OS == 'Linux' }}
6477
with:
6578
name: ${{ github.run_id }}-ubuntu-latest
6679

80+
- uses: actions/download-artifact@v4
81+
if: ${{ inputs.RUNNER_OS == 'Windows' }}
82+
with:
83+
name: ${{ github.run_id }}-windows-latest
84+
85+
- uses: actions/download-artifact@v4
86+
if: ${{ inputs.RUNNER_OS == 'macOS' }}
87+
with:
88+
name: ${{ github.run_id }}-macos-latest
89+
6790
- name: Uncompressed appflowy_flutter
6891
run: tar -xf appflowy_flutter.tar.gz
6992
shell: bash
7093

7194
- name: Run Flutter integration tests
7295
working-directory: frontend/appflowy_flutter
7396
run: |
74-
export DISPLAY=:99
75-
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
76-
sudo apt-get install network-manager
77-
flutter test ${{ inputs.test_path }} -d Linux --coverage
97+
if [ "$RUNNER_OS" == "Linux" ]; then
98+
export DISPLAY=:99
99+
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
100+
sudo apt-get install network-manager
101+
flutter test ${{ inputs.test_path }} -d Linux --coverage
102+
elif [ "$RUNNER_OS" == "Windows" ]; then
103+
flutter test ${{ inputs.test_path }} -d Windows --coverage
104+
elif [ "$RUNNER_OS" == "macOS" ]; then
105+
flutter test ${{ inputs.test_path }} -d macOS --coverage
106+
fi
78107
shell: bash

.github/workflows/flutter_ci.yaml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ jobs:
339339
flutter test integration_test/desktop/cloud/cloud_runner.dart -d Linux --coverage
340340
shell: bash
341341

342-
integration_test:
342+
linux_integration_test:
343343
needs: [prepare-linux]
344344
if: github.event.pull_request.draft != true
345345
strategy:
@@ -358,6 +358,59 @@ jobs:
358358
- name: Flutter Integration Test ${{ matrix.test_number }}
359359
uses: ./.github/actions/flutter_integration_test
360360
with:
361+
os: ${{ matrix.os }}
362+
test_path: integration_test/desktop_runner_${{ matrix.test_number }}.dart
363+
flutter_version: ${{ env.FLUTTER_VERSION }}
364+
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
365+
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
366+
rust_target: ${{ matrix.target }}
367+
368+
windows_integration_test:
369+
needs: [prepare-windows]
370+
if: github.event.pull_request.draft != true
371+
strategy:
372+
fail-fast: false
373+
matrix:
374+
os: [windows-latest]
375+
test_number: [1, 2, 3, 4, 5, 6, 7, 8, 9]
376+
include:
377+
- os: windows-latest
378+
target: "x86_64-pc-windows-msvc"
379+
runs-on: ${{ matrix.os }}
380+
steps:
381+
- name: Checkout source code
382+
uses: actions/checkout@v4
383+
384+
- name: Flutter Integration Test ${{ matrix.test_number }}
385+
uses: ./.github/actions/flutter_integration_test
386+
with:
387+
os: ${{ matrix.os }}
388+
test_path: integration_test/desktop_runner_${{ matrix.test_number }}.dart
389+
flutter_version: ${{ env.FLUTTER_VERSION }}
390+
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
391+
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
392+
rust_target: ${{ matrix.target }}
393+
394+
macos_integration_test:
395+
needs: [prepare-macos]
396+
if: github.event.pull_request.draft != true
397+
strategy:
398+
fail-fast: false
399+
matrix:
400+
os: [macos-latest]
401+
test_number: [1, 2, 3, 4, 5, 6, 7, 8, 9]
402+
include:
403+
- os: macos-latest
404+
target: "x86_64-apple-darwin"
405+
runs-on: ${{ matrix.os }}
406+
steps:
407+
- name: Checkout source code
408+
uses: actions/checkout@v4
409+
410+
- name: Flutter Integration Test ${{ matrix.test_number }}
411+
uses: ./.github/actions/flutter_integration_test
412+
with:
413+
os: ${{ matrix.os }}
361414
test_path: integration_test/desktop_runner_${{ matrix.test_number }}.dart
362415
flutter_version: ${{ env.FLUTTER_VERSION }}
363416
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}

0 commit comments

Comments
 (0)