Skip to content

Commit 0471f36

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

File tree

3 files changed

+91
-11
lines changed

3 files changed

+91
-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: 52 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:
@@ -363,3 +363,54 @@ jobs:
363363
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
364364
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
365365
rust_target: ${{ matrix.target }}
366+
367+
windows_integration_test:
368+
needs: [prepare-windows]
369+
if: github.event.pull_request.draft != true
370+
strategy:
371+
fail-fast: false
372+
matrix:
373+
os: [windows-latest]
374+
test_number: [1, 2, 3, 4, 5, 6, 7, 8, 9]
375+
include:
376+
- os: windows-latest
377+
target: "x86_64-pc-windows-msvc"
378+
runs-on: ${{ matrix.os }}
379+
steps:
380+
- name: Checkout source code
381+
uses: actions/checkout@v4
382+
383+
- name: Flutter Integration Test ${{ matrix.test_number }}
384+
uses: ./.github/actions/flutter_integration_test
385+
with:
386+
os: ${{ matrix.os }}
387+
test_path: integration_test/desktop_runner_${{ matrix.test_number }}.dart
388+
flutter_version: ${{ env.FLUTTER_VERSION }}
389+
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
390+
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
391+
rust_target: ${{ matrix.target }}
392+
393+
macos_integration_test:
394+
needs: [prepare-macos]
395+
if: github.event.pull_request.draft != true
396+
strategy:
397+
fail-fast: false
398+
matrix:
399+
os: [macos-latest]
400+
test_number: [1, 2, 3, 4, 5, 6, 7, 8, 9]
401+
include:
402+
- os: macos-latest
403+
target: "x86_64-apple-darwin"
404+
runs-on: ${{ matrix.os }}
405+
steps:
406+
- name: Checkout source code
407+
uses: actions/checkout@v4
408+
409+
- name: Flutter Integration Test ${{ matrix.test_number }}
410+
uses: ./.github/actions/flutter_integration_test
411+
with:
412+
test_path: integration_test/desktop_runner_${{ matrix.test_number }}.dart
413+
flutter_version: ${{ env.FLUTTER_VERSION }}
414+
rust_toolchain: ${{ env.RUST_TOOLCHAIN }}
415+
cargo_make_version: ${{ env.CARGO_MAKE_VERSION }}
416+
rust_target: ${{ matrix.target }}

0 commit comments

Comments
 (0)