Skip to content

Commit adb73d0

Browse files
committed
chore: merge branch 'upstream/main' into feat/file-progress
2 parents fd238af + dddf5aa commit adb73d0

File tree

530 files changed

+24855
-9785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

530 files changed

+24855
-9785
lines changed
Lines changed: 197 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,197 @@
1-
# name: Android CI
2-
3-
# on:
4-
# push:
5-
# branches:
6-
# - "main"
7-
# paths:
8-
# - ".github/workflows/mobile_ci.yaml"
9-
# - "frontend/**"
10-
# - "!frontend/appflowy_tauri/**"
11-
12-
# pull_request:
13-
# branches:
14-
# - "main"
15-
# paths:
16-
# - ".github/workflows/mobile_ci.yaml"
17-
# - "frontend/**"
18-
# - "!frontend/appflowy_tauri/**"
19-
20-
# env:
21-
# CARGO_TERM_COLOR: always
22-
# FLUTTER_VERSION: "3.22.0"
23-
# RUST_TOOLCHAIN: "1.77.2"
24-
# CARGO_MAKE_VERSION: "0.36.6"
25-
26-
# concurrency:
27-
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
28-
# cancel-in-progress: true
29-
30-
# jobs:
31-
# build:
32-
# if: github.event.pull_request.draft != true
33-
# strategy:
34-
# fail-fast: true
35-
# matrix:
36-
# os: [macos-14]
37-
# runs-on: ${{ matrix.os }}
38-
39-
# steps:
40-
# - name: Check storage space
41-
# run: df -h
42-
43-
# # the following step is required to avoid running out of space
44-
# - name: Maximize build space
45-
# if: matrix.os == 'ubuntu-latest'
46-
# run: |
47-
# sudo rm -rf /usr/share/dotnet
48-
# sudo rm -rf /opt/ghc
49-
# sudo rm -rf "/usr/local/share/boost"
50-
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
51-
# sudo docker image prune --all --force
52-
# sudo rm -rf /opt/hostedtoolcache/codeQL
53-
# sudo rm -rf ${GITHUB_WORKSPACE}/.git
54-
# sudo rm -rf $ANDROID_HOME/ndk
55-
56-
# - name: Check storage space
57-
# run: df -h
58-
59-
# - name: Checkout source code
60-
# uses: actions/checkout@v4
61-
62-
# - uses: actions/setup-java@v4
63-
# with:
64-
# distribution: temurin
65-
# java-version: 11
66-
67-
# - name: Install Rust toolchain
68-
# id: rust_toolchain
69-
# uses: actions-rs/toolchain@v1
70-
# with:
71-
# toolchain: ${{ env.RUST_TOOLCHAIN }}
72-
# override: true
73-
# profile: minimal
74-
75-
# - name: Install flutter
76-
# id: flutter
77-
# uses: subosito/flutter-action@v2
78-
# with:
79-
# channel: "stable"
80-
# flutter-version: ${{ env.FLUTTER_VERSION }}
81-
82-
# - uses: gradle/gradle-build-action@v3
83-
# with:
84-
# gradle-version: 7.4.2
85-
86-
# - uses: davidB/rust-cargo-make@v1
87-
# with:
88-
# version: "0.36.6"
89-
90-
# - name: Install prerequisites
91-
# working-directory: frontend
92-
# run: |
93-
# rustup target install aarch64-linux-android
94-
# rustup target install x86_64-linux-android
95-
# cargo install --force duckscript_cli
96-
# cargo install cargo-ndk
97-
# if [ "$RUNNER_OS" == "Linux" ]; then
98-
# sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
99-
# sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
100-
# sudo apt-get update
101-
# sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
102-
# sudo apt-get install keybinder-3.0 libnotify-dev
103-
# sudo apt-get install gcc-multilib
104-
# elif [ "$RUNNER_OS" == "Windows" ]; then
105-
# vcpkg integrate install
106-
# elif [ "$RUNNER_OS" == "macOS" ]; then
107-
# echo 'do nothing'
108-
# fi
109-
# cargo make appflowy-flutter-deps-tools
110-
# shell: bash
111-
112-
# - name: Build AppFlowy
113-
# working-directory: frontend
114-
# run: |
115-
# cargo make --profile development-android appflowy-android-dev-ci
116-
117-
118-
# - name: Run integration tests
119-
# # https://github.com/ReactiveCircus/android-emulator-runner
120-
# uses: reactivecircus/android-emulator-runner@v2
121-
# with:
122-
# api-level: 32
123-
# arch: arm64-v8a
124-
# disk-size: 2048M
125-
# working-directory: frontend/appflowy_flutter
126-
# script: flutter test integration_test/runner.dart
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
paths:
8+
- ".github/workflows/mobile_ci.yaml"
9+
- "frontend/**"
10+
- "!frontend/appflowy_tauri/**"
11+
12+
pull_request:
13+
branches:
14+
- "main"
15+
paths:
16+
- ".github/workflows/mobile_ci.yaml"
17+
- "frontend/**"
18+
- "!frontend/appflowy_tauri/**"
19+
20+
env:
21+
CARGO_TERM_COLOR: always
22+
FLUTTER_VERSION: "3.22.3"
23+
RUST_TOOLCHAIN: "1.80.1"
24+
CARGO_MAKE_VERSION: "0.37.18"
25+
CLOUD_VERSION: 0.6.54-amd64
26+
27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
29+
cancel-in-progress: true
30+
31+
jobs:
32+
build:
33+
if: github.event.pull_request.draft != true
34+
strategy:
35+
fail-fast: true
36+
matrix:
37+
os: [ubuntu-latest]
38+
runs-on: ${{ matrix.os }}
39+
40+
steps:
41+
- name: Check storage space
42+
run:
43+
df -h
44+
45+
# the following step is required to avoid running out of space
46+
- name: Maximize build space
47+
if: matrix.os == 'ubuntu-latest'
48+
run: |
49+
sudo rm -rf /usr/share/dotnet
50+
sudo rm -rf /opt/ghc
51+
sudo rm -rf "/usr/local/share/boost"
52+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
53+
sudo docker image prune --all --force
54+
sudo rm -rf /opt/hostedtoolcache/codeQL
55+
sudo rm -rf ${GITHUB_WORKSPACE}/.git
56+
57+
- name: Check storage space
58+
run: df -h
59+
60+
- name: Checkout appflowy cloud code
61+
uses: actions/checkout@v4
62+
with:
63+
repository: AppFlowy-IO/AppFlowy-Cloud
64+
path: AppFlowy-Cloud
65+
66+
- name: Prepare appflowy cloud env
67+
working-directory: AppFlowy-Cloud
68+
run: |
69+
# log level
70+
cp deploy.env .env
71+
sed -i 's|RUST_LOG=.*|RUST_LOG=trace|' .env
72+
sed -i 's/GOTRUE_EXTERNAL_GOOGLE_ENABLED=.*/GOTRUE_EXTERNAL_GOOGLE_ENABLED=true/' .env
73+
sed -i 's|GOTRUE_MAILER_AUTOCONFIRM=.*|GOTRUE_MAILER_AUTOCONFIRM=true|' .env
74+
sed -i 's|API_EXTERNAL_URL=.*|API_EXTERNAL_URL=http://localhost|' .env
75+
76+
- name: Run Docker-Compose
77+
working-directory: AppFlowy-Cloud
78+
env:
79+
APPFLOWY_CLOUD_VERSION: ${{ env.CLOUD_VERSION }}
80+
APPFLOWY_HISTORY_VERSION: ${{ env.CLOUD_VERSION }}
81+
APPFLOWY_WORKER_VERSION: ${{ env.CLOUD_VERSION }}
82+
run: |
83+
container_id=$(docker ps --filter name=appflowy-cloud-appflowy_cloud-1 -q)
84+
if [ -z "$container_id" ]; then
85+
echo "AppFlowy-Cloud container is not running. Pulling and starting the container..."
86+
docker compose pull
87+
docker compose up -d
88+
echo "Waiting for the container to be ready..."
89+
sleep 10
90+
else
91+
running_image=$(docker inspect --format='{{index .Config.Image}}' "$container_id")
92+
if [ "$running_image" != "appflowy-cloud:$APPFLOWY_CLOUD_VERSION" ]; then
93+
echo "AppFlowy-Cloud is running with an incorrect version. Restarting with the correct version..."
94+
# Remove all containers if any exist
95+
if [ "$(docker ps -aq)" ]; then
96+
docker rm -f $(docker ps -aq)
97+
else
98+
echo "No containers to remove."
99+
fi
100+
101+
# Remove all volumes if any exist
102+
if [ "$(docker volume ls -q)" ]; then
103+
docker volume rm $(docker volume ls -q)
104+
else
105+
echo "No volumes to remove."
106+
fi
107+
docker compose pull
108+
docker compose up -d
109+
echo "Waiting for the container to be ready..."
110+
sleep 10
111+
docker ps -a
112+
docker compose logs
113+
else
114+
echo "AppFlowy-Cloud is running with the correct version."
115+
fi
116+
fi
117+
118+
- name: Checkout source code
119+
uses: actions/checkout@v4
120+
121+
- uses: actions/setup-java@v4
122+
with:
123+
distribution: temurin
124+
java-version: 11
125+
126+
- name: Install Rust toolchain
127+
id: rust_toolchain
128+
uses: actions-rs/toolchain@v1
129+
with:
130+
toolchain: ${{ env.RUST_TOOLCHAIN }}
131+
override: true
132+
profile: minimal
133+
134+
- name: Install flutter
135+
id: flutter
136+
uses: subosito/flutter-action@v2
137+
with:
138+
channel: "stable"
139+
flutter-version: ${{ env.FLUTTER_VERSION }}
140+
141+
- uses: gradle/gradle-build-action@v3
142+
with:
143+
gradle-version: 8.10
144+
145+
- uses: davidB/rust-cargo-make@v1
146+
with:
147+
version: ${{ env.CARGO_MAKE_VERSION }}
148+
149+
- name: Install prerequisites
150+
working-directory: frontend
151+
run: |
152+
rustup target install aarch64-linux-android
153+
rustup target install x86_64-linux-android
154+
rustup target add armv7-linux-androideabi
155+
cargo install --force duckscript_cli
156+
cargo install cargo-ndk
157+
if [ "$RUNNER_OS" == "Linux" ]; then
158+
sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
159+
sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
160+
sudo apt-get update
161+
sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
162+
sudo apt-get install keybinder-3.0 libnotify-dev
163+
sudo apt-get install gcc-multilib
164+
elif [ "$RUNNER_OS" == "Windows" ]; then
165+
vcpkg integrate install
166+
elif [ "$RUNNER_OS" == "macOS" ]; then
167+
echo 'do nothing'
168+
fi
169+
cargo make appflowy-flutter-deps-tools
170+
shell: bash
171+
172+
- name: Build AppFlowy
173+
working-directory: frontend
174+
run: |
175+
cargo make --profile development-android appflowy-core-dev-android
176+
cargo make --profile development-android code_generation
177+
cd rust-lib
178+
cargo clean
179+
180+
- name: Enable KVM group perms
181+
run: |
182+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
183+
sudo udevadm control --reload-rules
184+
sudo udevadm trigger --name-match=kvm
185+
186+
- name: Run integration tests
187+
# https://github.com/ReactiveCircus/android-emulator-runner
188+
uses: reactivecircus/android-emulator-runner@v2
189+
with:
190+
api-level: 33
191+
arch: x86_64
192+
disk-size: 2048M
193+
working-directory: frontend/appflowy_flutter
194+
disable-animations: true
195+
force-avd-creation: false
196+
target: google_apis
197+
script: flutter test integration_test/mobile/cloud/cloud_runner.dart

.github/workflows/docker_ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Docker-CI
22

33
on:
44
push:
5-
branches: ["main", "release/*"]
5+
branches: [ "main", "release/*" ]
66
pull_request:
7-
branches: ["main", "release/*"]
7+
branches: [ "main", "release/*" ]
88
workflow_dispatch:
99

1010
concurrency:

.github/workflows/flutter_ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ jobs:
346346
fail-fast: false
347347
matrix:
348348
os: [ubuntu-latest]
349-
test_number: [1, 2, 3, 4, 5, 6, 7, 8]
349+
test_number: [1, 2, 3, 4, 5, 6, 7, 8, 9]
350350
include:
351351
- os: ubuntu-latest
352352
target: "x86_64-unknown-linux-gnu"

0 commit comments

Comments
 (0)