mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
91 lines
No EOL
2.3 KiB
YAML
91 lines
No EOL
2.3 KiB
YAML
name: "Tests"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
IMAGE: appwrite-dev
|
|
CACHE_KEY: appwrite-dev-${{ github.event.pull_request.head.sha }}
|
|
|
|
on: [ pull_request ]
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup & Build Appwrite Image
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build Appwrite
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: false
|
|
tags: ${{ env.IMAGE }}
|
|
load: true
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar
|
|
build-args: |
|
|
DEBUG=false
|
|
TESTING=true
|
|
VERSION=dev
|
|
|
|
- name: Cache Docker Image
|
|
uses: actions/cache@v4
|
|
with:
|
|
key: ${{ env.CACHE_KEY }}
|
|
path: /tmp/${{ env.IMAGE }}.tar
|
|
|
|
e2e_service_test:
|
|
name: E2E Service Test
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
service: [
|
|
Sites
|
|
]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Load Cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
key: ${{ env.CACHE_KEY }}
|
|
path: /tmp/${{ env.IMAGE }}.tar
|
|
fail-on-cache-miss: true
|
|
|
|
- name: Load and Start Appwrite
|
|
run: |
|
|
docker load --input /tmp/${{ env.IMAGE }}.tar
|
|
docker compose up -d
|
|
sleep 30
|
|
|
|
- name: Wait for Open Runtimes
|
|
timeout-minutes: 3
|
|
run: |
|
|
while ! docker compose logs openruntimes-executor | grep -q "Executor is ready."; do
|
|
echo "Waiting for Executor to come online"
|
|
sleep 1
|
|
done
|
|
|
|
- name: Run ${{ matrix.service }} tests with Project table mode
|
|
run: |
|
|
echo "Using project tables"
|
|
export _APP_DATABASE_SHARED_TABLES=
|
|
export _APP_DATABASE_SHARED_TABLES_V1=
|
|
|
|
docker compose exec -T \
|
|
-e _APP_DATABASE_SHARED_TABLES \
|
|
-e _APP_DATABASE_SHARED_TABLES_V1 \
|
|
appwrite test /usr/src/code/tests/e2e/Services/${{ matrix.service }} --debug |