Skip to content

Commit

Permalink
chore: merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
speed2exe committed Nov 19, 2024
2 parents 787e6be + 13cabec commit d7478fb
Show file tree
Hide file tree
Showing 152 changed files with 2,679 additions and 3,860 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ env:
LOCALHOST_URL: http://localhost
LOCALHOST_WS: ws://localhost/ws/v1
APPFLOWY_REDIS_URI: redis://redis:6379
APPFLOWY_AI_REDIS_URL: redis://redis:6379
LOCALHOST_GOTRUE: http://localhost/gotrue
POSTGRES_PASSWORD: password
DATABASE_URL: postgres://postgres:password@localhost:5432/postgres
Expand All @@ -44,20 +45,17 @@ jobs:
- name: Build Docker Images
run: |
export DOCKER_DEFAULT_PLATFORM=linux/amd64
docker compose build appflowy_cloud appflowy_history appflowy_worker admin_frontend
docker compose build appflowy_cloud appflowy_worker admin_frontend
- name: Push docker images to docker hub
run: |
docker tag appflowyinc/appflowy_cloud appflowyinc/appflowy_cloud:${GITHUB_SHA}
docker tag appflowyinc/appflowy_history appflowyinc/appflowy_history:${GITHUB_SHA}
docker tag appflowyinc/appflowy_worker appflowyinc/appflowy_worker:${GITHUB_SHA}
docker tag appflowyinc/admin_frontend appflowyinc/admin_frontend:${GITHUB_SHA}
echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login --username appflowyinc --password-stdin
docker push appflowyinc/appflowy_cloud:${GITHUB_SHA}
docker push appflowyinc/appflowy_history:${GITHUB_SHA}
docker push appflowyinc/appflowy_worker:${GITHUB_SHA}
docker push appflowyinc/admin_frontend:${GITHUB_SHA}
APPFLOWY_HISTORY_VERSION=${GITHUB_SHA}
APPFLOWY_WORKER_VERSION=${GITHUB_SHA}
APPFLOWY_CLOUD_VERSION=${GITHUB_SHA}
APPFLOWY_ADMIN_FRONTEND_VERSION=${GITHUB_SHA}
Expand All @@ -71,8 +69,6 @@ jobs:
include:
- test_service: "appflowy_cloud"
test_cmd: "--workspace --exclude appflowy-history --exclude appflowy-ai-client --features ai-test-enabled"
- test_service: "appflowy_history"
test_cmd: "-p appflowy-history"
- test_service: "appflowy_worker"
test_cmd: "-p appflowy-worker"
- test_service: "admin_frontend"
Expand Down Expand Up @@ -110,38 +106,34 @@ jobs:
# the wasm-pack headless tests will run on random ports, so we need to allow all origins
run: sed -i 's/http:\/\/127\.0\.0\.1:8000/http:\/\/127.0.0.1/g' nginx/nginx.conf

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Run Docker-Compose
run: |
export APPFLOWY_HISTORY_VERSION=${GITHUB_SHA}
export APPFLOWY_WORKER_VERSION=${GITHUB_SHA}
export APPFLOWY_CLOUD_VERSION=${GITHUB_SHA}
export APPFLOWY_ADMIN_FRONTEND_VERSION=${GITHUB_SHA}
docker compose -f docker-compose-ci.yml up -d
docker ps -a
container_id=$(docker ps --filter name=appflowy-cloud-ai-1 -q)
if [ -n "$container_id" ]; then
echo "Displaying logs for the AppFlowy-AI container..."
docker logs "$container_id"
else
echo "No running container found to display logs."
fi
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler
sudo apt-get install -y protobuf-compiler
- name: Run Tests
run: |
echo "Running tests for ${{ matrix.test_service }} with flags: ${{ matrix.test_cmd }}"
RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test ${{ matrix.test_cmd }}
- name: Run Tests from main branch
- name: Docker Logs
if: always()
run: |
git fetch origin main
git checkout main
RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test ${{ matrix.test_cmd }}
docker logs appflowy-cloud-ai-1
cleanup:
name: Cleanup Docker Images
Expand Down
97 changes: 1 addition & 96 deletions .github/workflows/push_latest_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
provenance: false
build-args: |
PROFILE=release
FEATURES=
- name: Logout from Docker Hub
Expand Down Expand Up @@ -238,102 +239,6 @@ jobs:
if: always()
run: docker logout

appflowy_history_image:
runs-on: ubuntu-22.04
env:
IMAGE_NAME: ${{ secrets.DOCKER_HUB_USERNAME }}/appflowy_history
strategy:
fail-fast: false
matrix:
job:
- { name: "amd64", docker_platform: "linux/amd64" }
- { name: "arm64v8", docker_platform: "linux/arm64" }

steps:
- name: Check out the repository
uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Get git tag
id: vars
run: |
T=${GITHUB_REF#refs/*/} # Remove "refs/*/" prefix from GITHUB_REF
echo "GIT_TAG=$T" >> $GITHUB_ENV
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: registry.hub.docker.com/${{ env.IMAGE_NAME }}

- name: Build and push ${{ matrix.job.image_name }}:${{ env.GIT_TAG }}
uses: docker/build-push-action@v5
with:
platforms: ${{ matrix.job.docker_platform }}
file: ./services/appflowy-history/Dockerfile
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.LATEST_TAG }}-${{ matrix.job.name }}
${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }}-${{ matrix.job.name }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false

- name: Logout from Docker Hub
if: always()
run: docker logout

appflowy_history_manifest:
runs-on: ubuntu-22.04
needs: [ appflowy_history_image ]
strategy:
fail-fast: false
matrix:
job:
- { image_name: "appflowy_history" }

steps:
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Get git tag
id: vars
run: |
T=${GITHUB_REF#refs/*/} # Remove "refs/*/" prefix from GITHUB_REF
echo "GIT_TAG=$T" >> $GITHUB_ENV
- name: Create and push manifest for ${{ matrix.job.image_name }}:version
uses: Noelware/docker-manifest-action@master
with:
inputs: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.job.image_name }}:${{ env.GIT_TAG }}
images: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.job.image_name }}:${{ env.GIT_TAG }}-amd64,${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.job.image_name }}:${{ env.GIT_TAG }}-arm64v8
push: true

- name: Create and push manifest for ${{ matrix.job.image_name }}:latest
uses: Noelware/docker-manifest-action@master
with:
inputs: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.job.image_name }}:${{ env.LATEST_TAG }}
images: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.job.image_name }}:${{ env.LATEST_TAG }}-amd64,${{ secrets.DOCKER_HUB_USERNAME }}/${{ matrix.job.image_name }}:${{ env.LATEST_TAG }}-arm64v8
push: true

- name: Logout from Docker Hub
if: always()
run: docker logout

appflowy_worker_image:
runs-on: ubuntu-22.04
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d7478fb

Please sign in to comment.