From addc88ccdca932148baef1831016477fb308cfd4 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 18:49:02 +0000 Subject: [PATCH 01/48] chore: test parallel executions --- .github/workflows/tests.yml | 36 +++++++++++++++++++++++++++++------- composer.lock | 2 +- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8fb3ac3518..8c96c4b74d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,8 +6,8 @@ concurrency: on: [pull_request] jobs: - tests: - name: Unit & E2E + build: + name: Build & Unit Test runs-on: ubuntu-latest steps: @@ -49,12 +49,34 @@ jobs: sleep 30 - name: Doctor - run: | - docker compose logs appwrite - docker compose exec -T appwrite doctor + run: docker compose exec -T appwrite doctor - name: Environment Variables run: docker compose exec -T appwrite vars - - name: Run Tests - run: docker compose exec -T appwrite test --debug \ No newline at end of file + - name: Run Unit Tests + run: docker compose exec appwrite test /usr/src/code/tests/unit + + e2e_test: + name: E2E Test + runs-on: ubuntu-latest + needs: build + strategy: + fail-fast: false + matrix: + services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] + + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + submodules: recursive + + - name: Start Appwrite + run: | + docker compose up -d + sleep 30 + + - name: Run ${{matrix.services}} Tests + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file diff --git a/composer.lock b/composer.lock index 7d412e42c4..23ea118869 100644 --- a/composer.lock +++ b/composer.lock @@ -6096,5 +6096,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From 2eae37d8025dc83b6dc06430e81dccfcfee63abb Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 19:03:55 +0000 Subject: [PATCH 02/48] feat: test upload artifact --- .github/workflows/tests.yml | 93 ++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 31 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c96c4b74d..22ce93bb39 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,10 +4,13 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + TAG: appwrite-dev + on: [pull_request] jobs: - build: - name: Build & Unit Test + setup: + name: Setup & Build Appwrite Image runs-on: ubuntu-latest steps: @@ -25,58 +28,86 @@ jobs: - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - # This is a separate action that sets up buildx runner - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build Appwrite uses: docker/build-push-action@v3 with: context: . push: false - tags: appwrite-dev + tags: $TAG load: true cache-from: type=gha cache-to: type=gha,mode=max + outputs: type=docker,dest=/tmp/$TAG.tar build-args: | DEBUG=false TESTING=true VERSION=dev + + - name: Upload Docker Image + uses: actions/upload-artifact@v3 + with: + name: $TAG + path: /tmp/$TAG.tar - - name: Start Appwrite - run: | - docker compose up -d - sleep 30 - - name: Doctor - run: docker compose exec -T appwrite doctor + # - name: Start Appwrite + # run: | + # docker compose up -d + # sleep 30 - - name: Environment Variables - run: docker compose exec -T appwrite vars + # - name: Doctor + # run: docker compose exec -T appwrite doctor - - name: Run Unit Tests - run: docker compose exec appwrite test /usr/src/code/tests/unit + # - name: Environment Variables + # run: docker compose exec -T appwrite vars - e2e_test: - name: E2E Test + # - name: Run Unit Tests + # run: docker compose exec appwrite test /usr/src/code/tests/unit + + unit_test: + name: Unit Test runs-on: ubuntu-latest - needs: build - strategy: - fail-fast: false - matrix: - services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] + needs: setup steps: - name: checkout uses: actions/checkout@v2 with: - fetch-depth: 2 + fetch-depth: 1 submodules: recursive + + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: $TAG + path: /tmp + + - name: Load Docker image + run: | + docker load --input /tmp/$TAG.tar + docker image ls -a - - name: Start Appwrite - run: | - docker compose up -d - sleep 30 + + # e2e_test: + # name: E2E Test + # runs-on: ubuntu-latest + # needs: build + # strategy: + # fail-fast: false + # matrix: + # services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] + + # steps: + # - name: checkout + # uses: actions/checkout@v2 + # with: + # fetch-depth: 2 + # submodules: recursive + + # - name: Start Appwrite + # run: | + # docker compose up -d + # sleep 30 - - name: Run ${{matrix.services}} Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file + # - name: Run ${{matrix.services}} Tests + # run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file From 1e07fa96a35f31aad6e5b64598c52b21dd6db7fc Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 19:06:10 +0000 Subject: [PATCH 03/48] feat: test upload artifact --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 22ce93bb39..3a4de4ed4c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,10 @@ jobs: - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} + # This is a separate action that sets up buildx runner + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Build Appwrite uses: docker/build-push-action@v3 with: From 57e146be2b14e41de037b8c7b5f9d9d64b4d1051 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 19:11:00 +0000 Subject: [PATCH 04/48] feat: test upload artifact --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3a4de4ed4c..874c4b341b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,13 +31,13 @@ jobs: # This is a separate action that sets up buildx runner - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - + - name: Build Appwrite uses: docker/build-push-action@v3 with: context: . push: false - tags: $TAG + tags: TAG load: true cache-from: type=gha cache-to: type=gha,mode=max From 22c878104729ba790f645dc1244ccd3bce05e2a6 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 19:11:57 +0000 Subject: [PATCH 05/48] feat: test upload artifact --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 874c4b341b..bea74325ee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,7 +37,7 @@ jobs: with: context: . push: false - tags: TAG + tags: ${{ TAG }} load: true cache-from: type=gha cache-to: type=gha,mode=max From 2aad9e622bc4dc3e763ca60c447fefbdf3628745 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 19:16:25 +0000 Subject: [PATCH 06/48] feat: trigger ci From fa99c4584e9ab2ee6684044b4be18da6af8fead5 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 20:07:13 +0000 Subject: [PATCH 07/48] feat: test upload artifact --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bea74325ee..bf82969559 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,6 +8,7 @@ env: TAG: appwrite-dev on: [pull_request] + jobs: setup: name: Setup & Build Appwrite Image @@ -37,7 +38,7 @@ jobs: with: context: . push: false - tags: ${{ TAG }} + tags: $TAG load: true cache-from: type=gha cache-to: type=gha,mode=max From 13c6666883e6eea35bc28dceb235b7b75400c9cb Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 21:29:11 +0000 Subject: [PATCH 08/48] feat: test upload artifact --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bf82969559..d5075f1376 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,11 +38,11 @@ jobs: with: context: . push: false - tags: $TAG + tags: ${{ env.TAG }} load: true cache-from: type=gha cache-to: type=gha,mode=max - outputs: type=docker,dest=/tmp/$TAG.tar + outputs: type=docker,dest=/tmp/${{ env.TAG }}.tar build-args: | DEBUG=false TESTING=true @@ -51,8 +51,8 @@ jobs: - name: Upload Docker Image uses: actions/upload-artifact@v3 with: - name: $TAG - path: /tmp/$TAG.tar + name: ${{ env.TAG }} + path: /tmp/${{ env.TAG }}.tar # - name: Start Appwrite From 8bd822d171f2a71a4fa3ab5f1b772276598fe3aa Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 21:35:01 +0000 Subject: [PATCH 09/48] feat: test upload artifact --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d5075f1376..0a657d352f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -84,12 +84,12 @@ jobs: - name: Download artifact uses: actions/download-artifact@v3 with: - name: $TAG + name: ${{ env.TAG }} path: /tmp - name: Load Docker image run: | - docker load --input /tmp/$TAG.tar + docker load --input /tmp/${{ env.TAG }}.tar docker image ls -a From dec4f4722b243579121a51c5e756154cf77412da Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 21:43:18 +0000 Subject: [PATCH 10/48] feat: test upload artifact --- .github/workflows/tests.yml | 39 +++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a657d352f..398032efba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,26 +48,17 @@ jobs: TESTING=true VERSION=dev - - name: Upload Docker Image - uses: actions/upload-artifact@v3 + - name: Cache Docker Image + uses: actions/cache@v3 with: - name: ${{ env.TAG }} + key: ${{ env.TAG }} path: /tmp/${{ env.TAG }}.tar - - # - name: Start Appwrite - # run: | - # docker compose up -d - # sleep 30 - - # - name: Doctor - # run: docker compose exec -T appwrite doctor - - # - name: Environment Variables - # run: docker compose exec -T appwrite vars - - # - name: Run Unit Tests - # run: docker compose exec appwrite test /usr/src/code/tests/unit + # - name: Upload Docker Image + # uses: actions/upload-artifact@v3 + # with: + # name: ${{ env.TAG }} + # path: /tmp/${{ env.TAG }}.tar unit_test: name: Unit Test @@ -92,6 +83,20 @@ jobs: docker load --input /tmp/${{ env.TAG }}.tar docker image ls -a + - name: Start Appwrite + run: | + docker compose up -d + sleep 10 + + - name: Doctor + run: docker compose exec -T appwrite doctor + + - name: Environment Variables + run: docker compose exec -T appwrite vars + + - name: Run Unit Tests + run: docker compose exec appwrite test /usr/src/code/tests/unit + # e2e_test: # name: E2E Test From 27f77759ed9192982c1893ca64c5975bd33db9e6 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 21:48:31 +0000 Subject: [PATCH 11/48] feat: test upload artifact --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 398032efba..5c65650dfa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,6 @@ jobs: - name: Cache Docker Image uses: actions/cache@v3 with: - key: ${{ env.TAG }} path: /tmp/${{ env.TAG }}.tar # - name: Upload Docker Image From cf030457e062a6a677488493dee9720ec6ff8737 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 21:55:28 +0000 Subject: [PATCH 12/48] feat: test upload artifact --- .github/workflows/tests.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5c65650dfa..479442fd68 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,6 +51,7 @@ jobs: - name: Cache Docker Image uses: actions/cache@v3 with: + key: ${{ env.TAG }} path: /tmp/${{ env.TAG }}.tar # - name: Upload Docker Image @@ -71,11 +72,17 @@ jobs: fetch-depth: 1 submodules: recursive - - name: Download artifact - uses: actions/download-artifact@v3 + # - name: Download artifact + # uses: actions/download-artifact@v3 + # with: + # name: ${{ env.TAG }} + # path: /tmp + + - name: Get Cached Docker Image + uses: actions/cache@v3 with: - name: ${{ env.TAG }} - path: /tmp + key: ${{ env.TAG }} + path: /tmp/${{ env.TAG }}.tar - name: Load Docker image run: | From 2ed6327c1e1cd3badf8fdd5c491ef31e5cee25ae Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 22:03:32 +0000 Subject: [PATCH 13/48] feat: test upload artifact --- .github/workflows/tests.yml | 43 +++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 479442fd68..299cf54046 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,11 +48,11 @@ jobs: TESTING=true VERSION=dev - - name: Cache Docker Image - uses: actions/cache@v3 - with: - key: ${{ env.TAG }} - path: /tmp/${{ env.TAG }}.tar + # - name: Cache Docker Image + # uses: actions/cache@v3 + # with: + # key: ${{ env.TAG }} + # path: /tmp/${{ env.TAG }}.tar # - name: Upload Docker Image # uses: actions/upload-artifact@v3 @@ -78,7 +78,7 @@ jobs: # name: ${{ env.TAG }} # path: /tmp - - name: Get Cached Docker Image + - name: Load Cache uses: actions/cache@v3 with: key: ${{ env.TAG }} @@ -104,6 +104,37 @@ jobs: run: docker compose exec appwrite test /usr/src/code/tests/unit + accounts_test: + name: Accounts Test + runs-on: ubuntu-latest + needs: setup + + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + submodules: recursive + + - name: Load Cache + uses: actions/cache@v3 + with: + key: ${{ env.TAG }} + path: /tmp/${{ env.TAG }}.tar + + - name: Load Docker image + run: | + docker load --input /tmp/${{ env.TAG }}.tar + docker image ls -a + + - name: Start Appwrite + run: | + docker compose up -d + sleep 10 + + - name: Run Accounts Tests + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/Account --debug + # e2e_test: # name: E2E Test # runs-on: ubuntu-latest From 5793a11480066f801432c97f2069c4934a6c703b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 22:10:56 +0000 Subject: [PATCH 14/48] feat: test upload artifact --- .github/workflows/tests.yml | 73 ++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 299cf54046..46b5d361ee 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -104,19 +104,55 @@ jobs: run: docker compose exec appwrite test /usr/src/code/tests/unit - accounts_test: - name: Accounts Test + # accounts_test: + # name: Accounts Test + # runs-on: ubuntu-latest + # needs: setup + + # steps: + # - name: checkout + # uses: actions/checkout@v2 + # with: + # fetch-depth: 1 + # submodules: recursive + + # - name: Load Cache + # uses: actions/cache@v3 + # with: + # key: ${{ env.TAG }} + # path: /tmp/${{ env.TAG }}.tar + + # - name: Load Docker image + # run: | + # docker load --input /tmp/${{ env.TAG }}.tar + # docker image ls -a + + # - name: Start Appwrite + # run: | + # docker compose up -d + # sleep 10 + + # - name: Run Accounts Tests + # run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/Account --debug + + e2e_test: + name: E2E Test runs-on: ubuntu-latest needs: setup + strategy: + fail-fast: false + matrix: + services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] steps: - name: checkout uses: actions/checkout@v2 with: - fetch-depth: 1 + fetch-depth: 2 submodules: recursive - name: Load Cache + id: load-cache uses: actions/cache@v3 with: key: ${{ env.TAG }} @@ -128,33 +164,10 @@ jobs: docker image ls -a - name: Start Appwrite + if: steps.load-cache.outputs.cache-hit == 'true' run: | docker compose up -d - sleep 10 - - - name: Run Accounts Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/Account --debug - - # e2e_test: - # name: E2E Test - # runs-on: ubuntu-latest - # needs: build - # strategy: - # fail-fast: false - # matrix: - # services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] - - # steps: - # - name: checkout - # uses: actions/checkout@v2 - # with: - # fetch-depth: 2 - # submodules: recursive - - # - name: Start Appwrite - # run: | - # docker compose up -d - # sleep 30 + sleep 20 - # - name: Run ${{matrix.services}} Tests - # run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file + - name: Run ${{matrix.services}} Tests + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file From 5cb14fbec5364fc34f5e7ebcba1ac6312e7aac65 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 22:11:40 +0000 Subject: [PATCH 15/48] feat: test upload artifact --- .github/workflows/tests.yml | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 46b5d361ee..396e8bbcc7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,7 +5,7 @@ concurrency: cancel-in-progress: true env: - TAG: appwrite-dev + IMAGE: appwrite-dev on: [pull_request] @@ -38,27 +38,27 @@ jobs: with: context: . push: false - tags: ${{ env.TAG }} + tag: ${{ env.IMAGE }} load: true cache-from: type=gha cache-to: type=gha,mode=max - outputs: type=docker,dest=/tmp/${{ env.TAG }}.tar + outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar build-args: | DEBUG=false TESTING=true VERSION=dev - # - name: Cache Docker Image - # uses: actions/cache@v3 - # with: - # key: ${{ env.TAG }} - # path: /tmp/${{ env.TAG }}.tar + - name: Cache Docker Image + uses: actions/cache@v3 + with: + key: ${{ env.IMAGE }} + path: /tmp/${{ env.IMAGE }}.tar # - name: Upload Docker Image # uses: actions/upload-artifact@v3 # with: - # name: ${{ env.TAG }} - # path: /tmp/${{ env.TAG }}.tar + # name: ${{ env.IMAGE }} + # path: /tmp/${{ env.IMAGE }}.tar unit_test: name: Unit Test @@ -75,18 +75,18 @@ jobs: # - name: Download artifact # uses: actions/download-artifact@v3 # with: - # name: ${{ env.TAG }} + # name: ${{ env.IMAGE }} # path: /tmp - name: Load Cache uses: actions/cache@v3 with: - key: ${{ env.TAG }} - path: /tmp/${{ env.TAG }}.tar + key: ${{ env.IMAGE }} + path: /tmp/${{ env.IMAGE }}.tar - name: Load Docker image run: | - docker load --input /tmp/${{ env.TAG }}.tar + docker load --input /tmp/${{ env.IMAGE }}.tar docker image ls -a - name: Start Appwrite @@ -119,12 +119,12 @@ jobs: # - name: Load Cache # uses: actions/cache@v3 # with: - # key: ${{ env.TAG }} - # path: /tmp/${{ env.TAG }}.tar + # key: ${{ env.IMAGE }} + # path: /tmp/${{ env.IMAGE }}.tar # - name: Load Docker image # run: | - # docker load --input /tmp/${{ env.TAG }}.tar + # docker load --input /tmp/${{ env.IMAGE }}.tar # docker image ls -a # - name: Start Appwrite @@ -155,12 +155,12 @@ jobs: id: load-cache uses: actions/cache@v3 with: - key: ${{ env.TAG }} - path: /tmp/${{ env.TAG }}.tar + key: ${{ env.IMAGE }} + path: /tmp/${{ env.IMAGE }}.tar - name: Load Docker image run: | - docker load --input /tmp/${{ env.TAG }}.tar + docker load --input /tmp/${{ env.IMAGE }}.tar docker image ls -a - name: Start Appwrite From 21357bfe7bbfa01d2a021ba217dc80d1a77daaf2 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 22:32:54 +0000 Subject: [PATCH 16/48] chore: update CI file --- .github/workflows/tests.yml | 76 ------------------------------------- 1 file changed, 76 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 396e8bbcc7..eff3a2fcc8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,23 +42,10 @@ jobs: 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@v3 - with: - key: ${{ env.IMAGE }} - path: /tmp/${{ env.IMAGE }}.tar - - # - name: Upload Docker Image - # uses: actions/upload-artifact@v3 - # with: - # name: ${{ env.IMAGE }} - # path: /tmp/${{ env.IMAGE }}.tar unit_test: name: Unit Test @@ -71,28 +58,10 @@ jobs: with: fetch-depth: 1 submodules: recursive - - # - name: Download artifact - # uses: actions/download-artifact@v3 - # with: - # name: ${{ env.IMAGE }} - # path: /tmp - - - name: Load Cache - uses: actions/cache@v3 - with: - key: ${{ env.IMAGE }} - path: /tmp/${{ env.IMAGE }}.tar - - - name: Load Docker image - run: | - docker load --input /tmp/${{ env.IMAGE }}.tar - docker image ls -a - name: Start Appwrite run: | docker compose up -d - sleep 10 - name: Doctor run: docker compose exec -T appwrite doctor @@ -103,38 +72,6 @@ jobs: - name: Run Unit Tests run: docker compose exec appwrite test /usr/src/code/tests/unit - - # accounts_test: - # name: Accounts Test - # runs-on: ubuntu-latest - # needs: setup - - # steps: - # - name: checkout - # uses: actions/checkout@v2 - # with: - # fetch-depth: 1 - # submodules: recursive - - # - name: Load Cache - # uses: actions/cache@v3 - # with: - # key: ${{ env.IMAGE }} - # path: /tmp/${{ env.IMAGE }}.tar - - # - name: Load Docker image - # run: | - # docker load --input /tmp/${{ env.IMAGE }}.tar - # docker image ls -a - - # - name: Start Appwrite - # run: | - # docker compose up -d - # sleep 10 - - # - name: Run Accounts Tests - # run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/Account --debug - e2e_test: name: E2E Test runs-on: ubuntu-latest @@ -151,20 +88,7 @@ jobs: fetch-depth: 2 submodules: recursive - - name: Load Cache - id: load-cache - uses: actions/cache@v3 - with: - key: ${{ env.IMAGE }} - path: /tmp/${{ env.IMAGE }}.tar - - - name: Load Docker image - run: | - docker load --input /tmp/${{ env.IMAGE }}.tar - docker image ls -a - - name: Start Appwrite - if: steps.load-cache.outputs.cache-hit == 'true' run: | docker compose up -d sleep 20 From ebb4bc7e6bad863c4ba8cd34e7cea2e5dc5ff66f Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 22:39:11 +0000 Subject: [PATCH 17/48] chore: update CI file --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eff3a2fcc8..696c80c35d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,7 @@ jobs: with: context: . push: false - tag: ${{ env.IMAGE }} + tags: ${{ env.IMAGE }} load: true cache-from: type=gha cache-to: type=gha,mode=max From 1415727f10f3a6084afa3bbf6e0d3514952e8ce1 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 22:53:50 +0000 Subject: [PATCH 18/48] chore: update CI file --- .github/workflows/tests.yml | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 696c80c35d..2206c39097 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,10 +42,23 @@ jobs: 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@v3 + with: + key: ${{ env.IMAGE }}-${{ github.sha }} + path: /tmp/${{ env.IMAGE }}.tar + + # - name: Upload Docker Image + # uses: actions/upload-artifact@v3 + # with: + # name: ${{ env.IMAGE }} + # path: /tmp/${{ env.IMAGE }}.tar unit_test: name: Unit Test @@ -58,10 +71,20 @@ jobs: with: fetch-depth: 1 submodules: recursive - - - name: Start Appwrite + + - name: Load Cache + uses: actions/cache@v3 + with: + key: ${{ env.IMAGE }}-${{ github.sha }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + if: steps.load-cache.outputs.cache-hit == 'true' run: | + docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d + sleep 10 - name: Doctor run: docker compose exec -T appwrite doctor @@ -88,8 +111,17 @@ jobs: fetch-depth: 2 submodules: recursive - - name: Start Appwrite + - name: Load Cache + uses: actions/cache@v3 + with: + key: ${{ env.IMAGE }}-${{ github.sha }} + path: /tmp/${{ env.IMAGE }}.tar + fail-on-cache-miss: true + + - name: Load and Start Appwrite + if: steps.load-cache.outputs.cache-hit == 'true' run: | + docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d sleep 20 From 733b7ed612e7c32979f05b0aba36b64c416ae172 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 22:57:25 +0000 Subject: [PATCH 19/48] chore: update CI file --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2206c39097..dc2dffca65 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -80,7 +80,6 @@ jobs: fail-on-cache-miss: true - name: Load and Start Appwrite - if: steps.load-cache.outputs.cache-hit == 'true' run: | docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d @@ -119,7 +118,6 @@ jobs: fail-on-cache-miss: true - name: Load and Start Appwrite - if: steps.load-cache.outputs.cache-hit == 'true' run: | docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d From 10f6cc7b0b2410361376239d84dc659c0c0a9c49 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:12:11 +0000 Subject: [PATCH 20/48] chore: update CI file --- .github/workflows/tests.yml | 124 +++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 60 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dc2dffca65..0720d4ce58 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,17 +42,21 @@ jobs: load: true cache-from: type=gha cache-to: type=gha,mode=max - outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar + # outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar build-args: | DEBUG=false TESTING=true VERSION=dev - - name: Cache Docker Image - uses: actions/cache@v3 - with: - key: ${{ env.IMAGE }}-${{ github.sha }} - path: /tmp/${{ env.IMAGE }}.tar + - name: Save Docker Images + run: | + docker images --filter="dangling=false" | sed '1d' | awk '{print $1 ":" $2 }' + + # - name: Cache Docker Image + # uses: actions/cache@v3 + # with: + # key: ${{ env.IMAGE }}-${{ github.sha }} + # path: /tmp/${{ env.IMAGE }}.tar # - name: Upload Docker Image # uses: actions/upload-artifact@v3 @@ -60,68 +64,68 @@ jobs: # name: ${{ env.IMAGE }} # path: /tmp/${{ env.IMAGE }}.tar - unit_test: - name: Unit Test - runs-on: ubuntu-latest - needs: setup + # unit_test: + # name: Unit Test + # runs-on: ubuntu-latest + # needs: setup - steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 1 - submodules: recursive + # steps: + # - name: checkout + # uses: actions/checkout@v2 + # with: + # fetch-depth: 1 + # submodules: recursive - - name: Load Cache - uses: actions/cache@v3 - with: - key: ${{ env.IMAGE }}-${{ github.sha }} - path: /tmp/${{ env.IMAGE }}.tar - fail-on-cache-miss: true + # - name: Load Cache + # uses: actions/cache@v3 + # with: + # key: ${{ env.IMAGE }}-${{ github.sha }} + # 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 10 + # - name: Load and Start Appwrite + # run: | + # docker load --input /tmp/${{ env.IMAGE }}.tar + # docker compose up -d + # sleep 10 - - name: Doctor - run: docker compose exec -T appwrite doctor + # - name: Doctor + # run: docker compose exec -T appwrite doctor - - name: Environment Variables - run: docker compose exec -T appwrite vars + # - name: Environment Variables + # run: docker compose exec -T appwrite vars - - name: Run Unit Tests - run: docker compose exec appwrite test /usr/src/code/tests/unit + # - name: Run Unit Tests + # run: docker compose exec appwrite test /usr/src/code/tests/unit - e2e_test: - name: E2E Test - runs-on: ubuntu-latest - needs: setup - strategy: - fail-fast: false - matrix: - services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] + # e2e_test: + # name: E2E Test + # runs-on: ubuntu-latest + # needs: setup + # strategy: + # fail-fast: false + # matrix: + # services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] - steps: - - name: checkout - uses: actions/checkout@v2 - with: - fetch-depth: 2 - submodules: recursive + # steps: + # - name: checkout + # uses: actions/checkout@v2 + # with: + # fetch-depth: 2 + # submodules: recursive - - name: Load Cache - uses: actions/cache@v3 - with: - key: ${{ env.IMAGE }}-${{ github.sha }} - path: /tmp/${{ env.IMAGE }}.tar - fail-on-cache-miss: true + # - name: Load Cache + # uses: actions/cache@v3 + # with: + # key: ${{ env.IMAGE }}-${{ github.sha }} + # 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 20 + # - name: Load and Start Appwrite + # run: | + # docker load --input /tmp/${{ env.IMAGE }}.tar + # docker compose up -d + # sleep 20 - - name: Run ${{matrix.services}} Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file + # - name: Run ${{matrix.services}} Tests + # run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file From 0f67c1151f023f46ef2e3ad55329333665e8017c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:18:26 +0000 Subject: [PATCH 21/48] chore: update CI file --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0720d4ce58..e2b6e1d8c7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,7 +50,7 @@ jobs: - name: Save Docker Images run: | - docker images --filter="dangling=false" | sed '1d' | awk '{print $1 ":" $2 }' + docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u # - name: Cache Docker Image # uses: actions/cache@v3 From 1a93aa408529e5c8fe047f240435aa68a61bda3b Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:24:16 +0000 Subject: [PATCH 22/48] chore: update CI file --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e2b6e1d8c7..3eaf13635b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,7 +50,9 @@ jobs: - name: Save Docker Images run: | + docker compose images docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u + # docker save $(docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u) -o allinone.tar # - name: Cache Docker Image # uses: actions/cache@v3 From eaf94aa670f1440667b8009b04a51262afcd9007 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:31:04 +0000 Subject: [PATCH 23/48] chore: update CI file --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3eaf13635b..8e26f79fcf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,8 +50,9 @@ jobs: - name: Save Docker Images run: | - docker compose images - docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u + docker image ls + # docker compose images + # docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u # docker save $(docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u) -o allinone.tar # - name: Cache Docker Image From 01aaa6b33789025e99dfbbeb3cff24f2d5e20391 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:34:23 +0000 Subject: [PATCH 24/48] chore: update CI file --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e26f79fcf..1d7e66b6b1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: - name: Save Docker Images run: | docker image ls - # docker compose images + docker compose images # docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u # docker save $(docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u) -o allinone.tar From 889942ee764c6247a3f00494c95fce3f663876b1 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:37:41 +0000 Subject: [PATCH 25/48] chore: update CI file --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d7e66b6b1..7c0230bcf2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,6 +51,7 @@ jobs: - name: Save Docker Images run: | docker image ls + docker compose pull docker compose images # docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u # docker save $(docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u) -o allinone.tar From 29d0820b10b990da73f2e7df3fcc205a88b79af7 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:41:16 +0000 Subject: [PATCH 26/48] chore: update CI file --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c0230bcf2..38423c0331 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: - name: Save Docker Images run: | docker image ls - docker compose pull + docker compose pull --ignore-pull-failures --ignore-buildable docker compose images # docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u # docker save $(docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u) -o allinone.tar From 0ddf036bd508a46a5b96cfdc1967b7e44e0a4d46 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:44:19 +0000 Subject: [PATCH 27/48] chore: update CI file --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 38423c0331..0f9260b176 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,11 +47,14 @@ jobs: DEBUG=false TESTING=true VERSION=dev + + - name: Pull Docker Images + run: docker compose pull --ignore-pull-failures --ignore-buildable - - name: Save Docker Images + - name: List Files and images run: | + ls docker image ls - docker compose pull --ignore-pull-failures --ignore-buildable docker compose images # docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u # docker save $(docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u) -o allinone.tar From 0a2874458b5cec67a005a94ecd43c92b8714cbac Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 8 Sep 2023 23:54:27 +0000 Subject: [PATCH 28/48] chore: update CI file --- .github/workflows/tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0f9260b176..62990984d9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,11 +53,9 @@ jobs: - name: List Files and images run: | - ls - docker image ls - docker compose images - # docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u - # docker save $(docker compose images | sed '1d' | awk '{ print $2 ":" $3 }' | sort -u) -o allinone.tar + docker compose config --images | sort -u + docker save $(docker compose config --images | sort -u) -o allinone.tar + stat allinone.tar # - name: Cache Docker Image # uses: actions/cache@v3 From 29e056c71b1175043d03f970204f53c372561d0a Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 00:00:06 +0000 Subject: [PATCH 29/48] chore: update CI file --- .github/workflows/tests.yml | 67 ++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 62990984d9..028599d7e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,14 +54,13 @@ jobs: - name: List Files and images run: | docker compose config --images | sort -u - docker save $(docker compose config --images | sort -u) -o allinone.tar - stat allinone.tar + docker save $(docker compose config --images | sort -u) -o /tmp/allinone.tar - # - name: Cache Docker Image - # uses: actions/cache@v3 - # with: - # key: ${{ env.IMAGE }}-${{ github.sha }} - # path: /tmp/${{ env.IMAGE }}.tar + - name: Cache Docker Image + uses: actions/cache@v3 + with: + key: ${{ env.IMAGE }}-${{ github.sha }} + path: /tmp/allinone.tar # - name: Upload Docker Image # uses: actions/upload-artifact@v3 @@ -69,39 +68,39 @@ jobs: # name: ${{ env.IMAGE }} # path: /tmp/${{ env.IMAGE }}.tar - # unit_test: - # name: Unit Test - # runs-on: ubuntu-latest - # needs: setup + unit_test: + name: Unit Test + runs-on: ubuntu-latest + needs: setup - # steps: - # - name: checkout - # uses: actions/checkout@v2 - # with: - # fetch-depth: 1 - # submodules: recursive + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + submodules: recursive - # - name: Load Cache - # uses: actions/cache@v3 - # with: - # key: ${{ env.IMAGE }}-${{ github.sha }} - # path: /tmp/${{ env.IMAGE }}.tar - # fail-on-cache-miss: true + - name: Load Cache + uses: actions/cache@v3 + with: + key: ${{ env.IMAGE }}-${{ github.sha }} + path: /tmp/allinone.tar + fail-on-cache-miss: true - # - name: Load and Start Appwrite - # run: | - # docker load --input /tmp/${{ env.IMAGE }}.tar - # docker compose up -d - # sleep 10 + - name: Load and Start Appwrite + run: | + docker load --input /tmp/allinone.tar + docker compose up -d + sleep 10 - # - name: Doctor - # run: docker compose exec -T appwrite doctor + - name: Doctor + run: docker compose exec -T appwrite doctor - # - name: Environment Variables - # run: docker compose exec -T appwrite vars + - name: Environment Variables + run: docker compose exec -T appwrite vars - # - name: Run Unit Tests - # run: docker compose exec appwrite test /usr/src/code/tests/unit + - name: Run Unit Tests + run: docker compose exec appwrite test /usr/src/code/tests/unit # e2e_test: # name: E2E Test From e390cf0d70cf7da273def57cd513e2dc954d5e91 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 00:11:14 +0000 Subject: [PATCH 30/48] chore: update CI file --- .github/workflows/tests.yml | 54 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 028599d7e8..5d83b4a2cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -102,34 +102,34 @@ jobs: - name: Run Unit Tests run: docker compose exec appwrite test /usr/src/code/tests/unit - # e2e_test: - # name: E2E Test - # runs-on: ubuntu-latest - # needs: setup - # strategy: - # fail-fast: false - # matrix: - # services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] + e2e_test: + name: E2E Test + runs-on: ubuntu-latest + needs: setup + strategy: + fail-fast: false + matrix: + services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] - # steps: - # - name: checkout - # uses: actions/checkout@v2 - # with: - # fetch-depth: 2 - # submodules: recursive + steps: + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + submodules: recursive - # - name: Load Cache - # uses: actions/cache@v3 - # with: - # key: ${{ env.IMAGE }}-${{ github.sha }} - # path: /tmp/${{ env.IMAGE }}.tar - # fail-on-cache-miss: true + - name: Load Cache + uses: actions/cache@v3 + with: + key: ${{ env.IMAGE }}-${{ github.sha }} + path: /tmp/allinone.tar + fail-on-cache-miss: true - # - name: Load and Start Appwrite - # run: | - # docker load --input /tmp/${{ env.IMAGE }}.tar - # docker compose up -d - # sleep 20 + - name: Load and Start Appwrite + run: | + docker load --input /tmp/allinone.tar + docker compose up -d + sleep 20 - # - name: Run ${{matrix.services}} Tests - # run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file + - name: Run ${{matrix.services}} Tests + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file From e70d5beb0d3235d25a52591feb63f41867e3a2fa Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 01:29:56 +0000 Subject: [PATCH 31/48] chore: update ci file --- .github/workflows/tests.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5d83b4a2cc..cf0eaac4ac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,25 +42,25 @@ jobs: load: true cache-from: type=gha cache-to: type=gha,mode=max - # outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar + outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar build-args: | DEBUG=false TESTING=true VERSION=dev - - name: Pull Docker Images - run: docker compose pull --ignore-pull-failures --ignore-buildable + # - name: Pull Docker Images + # run: docker compose pull --ignore-pull-failures --ignore-buildable - - name: List Files and images - run: | - docker compose config --images | sort -u - docker save $(docker compose config --images | sort -u) -o /tmp/allinone.tar + # - name: List Files and images + # run: | + # docker compose config --images | sort -u + # docker save $(docker compose config --images | sort -u) -o /tmp/allinone.tar - name: Cache Docker Image uses: actions/cache@v3 with: key: ${{ env.IMAGE }}-${{ github.sha }} - path: /tmp/allinone.tar + path: /tmp/${{ env.IMAGE }}.tar # - name: Upload Docker Image # uses: actions/upload-artifact@v3 @@ -84,12 +84,12 @@ jobs: uses: actions/cache@v3 with: key: ${{ env.IMAGE }}-${{ github.sha }} - path: /tmp/allinone.tar + path: /tmp/${{ env.IMAGE }}.tar fail-on-cache-miss: true - name: Load and Start Appwrite run: | - docker load --input /tmp/allinone.tar + docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d sleep 10 @@ -122,12 +122,12 @@ jobs: uses: actions/cache@v3 with: key: ${{ env.IMAGE }}-${{ github.sha }} - path: /tmp/allinone.tar + path: /tmp/${{ env.IMAGE }}.tar fail-on-cache-miss: true - name: Load and Start Appwrite run: | - docker load --input /tmp/allinone.tar + docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d sleep 20 From 238089409a673afa1388a0abf51a9e0b226e4ae5 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 01:39:01 +0000 Subject: [PATCH 32/48] chore: update ci file --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cf0eaac4ac..79cf57a37a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -130,6 +130,10 @@ jobs: docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d sleep 20 + + - name: Additional Sleep for Functions and GraphQL + if: ${{ matrix.services == 'Functions' || matrix.services == 'GraphQL' }} + run: sleep 30 - name: Run ${{matrix.services}} Tests run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file From 1c9dfb903d310dacc857f2f5ccd825aa0c9a789c Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 01:58:37 +0000 Subject: [PATCH 33/48] chore: update ci file --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 79cf57a37a..27f580f4ff 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -129,11 +129,11 @@ jobs: run: | docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d - sleep 20 + sleep 10 - - name: Additional Sleep for Functions and GraphQL - if: ${{ matrix.services == 'Functions' || matrix.services == 'GraphQL' }} - run: sleep 30 + - name: Additional Sleep for GraphQL + if: ${{ matrix.services == 'GraphQL' }} + run: sleep 60 - name: Run ${{matrix.services}} Tests run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file From ff4816a436cbd3381035a38e5028b5241bb64bcf Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 02:17:21 +0000 Subject: [PATCH 34/48] chore: update ci file --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 27f580f4ff..89bbc3b790 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -131,9 +131,9 @@ jobs: docker compose up -d sleep 10 - - name: Additional Sleep for GraphQL + - name: Output build logs if: ${{ matrix.services == 'GraphQL' }} - run: sleep 60 + run: docker compose logs appwrite-worker-builds - name: Run ${{matrix.services}} Tests run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file From 85fcddceade12722bed32e3f4db4881f756d8680 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 02:20:25 +0000 Subject: [PATCH 35/48] chore: update ci file --- phpunit.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index f83f9f0fae..3d15bbd21a 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" + stopOnFailure="true" > From 8a28c9ddbc1f9ce43b81756138efcccc20cf57c9 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 02:29:50 +0000 Subject: [PATCH 36/48] chore: update ci file --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 89bbc3b790..d570f91918 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -130,10 +130,10 @@ jobs: docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d sleep 10 + + - name: Run ${{matrix.services}} Tests + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug - name: Output build logs if: ${{ matrix.services == 'GraphQL' }} - run: docker compose logs appwrite-worker-builds - - - name: Run ${{matrix.services}} Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file + run: docker compose logs appwrite-worker-builds \ No newline at end of file From ab5fa9666841861f644e408d190d908a7a13f1f1 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Sat, 9 Sep 2023 02:39:51 +0000 Subject: [PATCH 37/48] chore: update ci file --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d570f91918..819b7c652b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -135,5 +135,5 @@ jobs: run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug - name: Output build logs - if: ${{ matrix.services == 'GraphQL' }} + if: always() && ${{ matrix.services == 'GraphQL' }} run: docker compose logs appwrite-worker-builds \ No newline at end of file From 80574838a49c67e0cdb88fbcda776f43d082387a Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 17 Oct 2023 15:19:29 +0200 Subject: [PATCH 38/48] gitpod: fix composer usage --- .gitpod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 4c081dd275..d740c467cb 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -8,7 +8,7 @@ tasks: command: | docker run --rm --interactive --tty \ --volume $PWD:/app \ - composer update \ + composer install \ --ignore-platform-reqs \ --optimize-autoloader \ --no-plugins \ From 9f3561aaa367d53de9b444ee35ac6346169421ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Thu, 19 Oct 2023 17:09:49 +0000 Subject: [PATCH 39/48] chore: cleanup ci file --- .github/workflows/tests.yml | 16 ---------------- composer.lock | 13 ++++++------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 819b7c652b..4576787d39 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,18 +18,8 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - # Fetch submodules submodules: recursive - # If this run was triggered by a pull request event, then checkout - # the head of the pull request instead of the merge commit. - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - # This is a separate action that sets up buildx runner - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -76,9 +66,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - with: - fetch-depth: 1 - submodules: recursive - name: Load Cache uses: actions/cache@v3 @@ -114,9 +101,6 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - with: - fetch-depth: 2 - submodules: recursive - name: Load Cache uses: actions/cache@v3 diff --git a/composer.lock b/composer.lock index e45e4b3d86..d88355c4cb 100644 --- a/composer.lock +++ b/composer.lock @@ -2283,23 +2283,22 @@ }, { "name": "utopia-php/logger", - "version": "0.3.2", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/utopia-php/logger.git", - "reference": "9151b7d16eab18d4c37c34643041cc0f33ca4a6c" + "reference": "de623f1ec1c672c795d113dd25c5bf212f7ef4fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/logger/zipball/9151b7d16eab18d4c37c34643041cc0f33ca4a6c", - "reference": "9151b7d16eab18d4c37c34643041cc0f33ca4a6c", + "url": "https://api.github.com/repos/utopia-php/logger/zipball/de623f1ec1c672c795d113dd25c5bf212f7ef4fc", + "reference": "de623f1ec1c672c795d113dd25c5bf212f7ef4fc", "shasum": "" }, "require": { "php": ">=8.0" }, "require-dev": { - "laravel/pint": "1.2.*", "phpstan/phpstan": "1.9.x-dev", "phpunit/phpunit": "^9.3", "vimeo/psalm": "4.0.1" @@ -2331,9 +2330,9 @@ ], "support": { "issues": "https://github.com/utopia-php/logger/issues", - "source": "https://github.com/utopia-php/logger/tree/0.3.2" + "source": "https://github.com/utopia-php/logger/tree/0.3.1" }, - "time": "2023-10-16T08:16:19+00:00" + "time": "2023-02-10T15:52:50+00:00" }, { "name": "utopia-php/messaging", From c0f099e176e50d744bcefea7d967ac6912498428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Sun, 22 Oct 2023 15:28:39 +0000 Subject: [PATCH 40/48] chore: update test file --- .github/workflows/tests.yml | 1 - phpunit.xml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4576787d39..d9d94e8434 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,6 @@ jobs: setup: name: Setup & Build Appwrite Image runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/phpunit.xml b/phpunit.xml index 99ccaf1755..975b54962a 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,7 +6,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="true" + stopOnFailure="false" > From 191235ecaf0d130b8cbda1f155c5e525597400ed Mon Sep 17 00:00:00 2001 From: KRISH SONI <67964054+krishvsoni@users.noreply.github.com> Date: Wed, 25 Oct 2023 23:24:26 +0530 Subject: [PATCH 41/48] added docs url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4980d0e61..6503f6addf 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Table of Contents: ## Installation -Appwrite is designed to run in a containerized environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool, such as Kubernetes, Docker Swarm, or Rancher. +Appwrite is designed to run in a containerized environment. Running your server is as easy as running one command from your terminal. You can either run Appwrite on your localhost using docker-compose or on any other container orchestration tool, such as [Kubernetes](https://kubernetes.io/docs/home/), [Docker Swarm](https://docs.docker.com/engine/swarm/), or [Rancher](https://rancher.com/docs/). The easiest way to start running your Appwrite server is by running our docker-compose file. Before running the installation command, make sure you have [Docker](https://www.docker.com/products/docker-desktop) installed on your machine: From 995c404f352ff40a9fbf89de3820b8ebc465482b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 26 Oct 2023 21:24:30 +1300 Subject: [PATCH 42/48] Update db --- app/worker.php | 3 +-- composer.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/worker.php b/app/worker.php index f1f19e3cca..32a8b9804e 100644 --- a/app/worker.php +++ b/app/worker.php @@ -33,10 +33,9 @@ use Utopia\Logger\Logger; use Utopia\Pools\Group; use Utopia\Queue\Connection; -Authorization::setDefaultStatus(false); +Authorization::disable(); Runtime::enableCoroutine(SWOOLE_HOOK_ALL); - Server::setResource('register', fn () => $register); Server::setResource('dbForConsole', function (Cache $cache, Registry $register) { diff --git a/composer.lock b/composer.lock index a9121a6dcf..cb467be2de 100644 --- a/composer.lock +++ b/composer.lock @@ -1906,16 +1906,16 @@ }, { "name": "utopia-php/database", - "version": "0.44.3", + "version": "0.44.4", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "b2d403c25a77506e03db5736335b0cae52bcc18a" + "reference": "b0c3fd8ecfedc3646d7780f2d6b38955a66baf48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/b2d403c25a77506e03db5736335b0cae52bcc18a", - "reference": "b2d403c25a77506e03db5736335b0cae52bcc18a", + "url": "https://api.github.com/repos/utopia-php/database/zipball/b0c3fd8ecfedc3646d7780f2d6b38955a66baf48", + "reference": "b0c3fd8ecfedc3646d7780f2d6b38955a66baf48", "shasum": "" }, "require": { @@ -1956,9 +1956,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/0.44.3" + "source": "https://github.com/utopia-php/database/tree/0.44.4" }, - "time": "2023-10-24T10:13:48+00:00" + "time": "2023-10-26T07:08:12+00:00" }, { "name": "utopia-php/domains", From c3a80dcebc44fa4b39de5ac9427230672f82c2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 26 Oct 2023 16:50:35 +0200 Subject: [PATCH 43/48] Fix GraphQL function test --- tests/e2e/Services/GraphQL/Base.php | 11 +++++++++++ tests/e2e/Services/GraphQL/FunctionsClientTest.php | 6 +++++- tests/e2e/Services/GraphQL/FunctionsServerTest.php | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/GraphQL/Base.php b/tests/e2e/Services/GraphQL/Base.php index 3a4b88e2c2..f705e8d77b 100644 --- a/tests/e2e/Services/GraphQL/Base.php +++ b/tests/e2e/Services/GraphQL/Base.php @@ -2,6 +2,8 @@ namespace Tests\E2E\Services\GraphQL; +use Utopia\CLI\Console; + trait Base { // Databases @@ -1933,4 +1935,13 @@ trait Base throw new \InvalidArgumentException('Invalid query type'); } + + // Function-related methods + protected string $stdout = ''; + protected string $stderr = ''; + + protected function packageCode($folder) + { + Console::execute('cd ' . realpath(__DIR__ . "/../../../resources/functions") . "/$folder && tar --exclude code.tar.gz -czf code.tar.gz .", '', $this->stdout, $this->stderr); + } } diff --git a/tests/e2e/Services/GraphQL/FunctionsClientTest.php b/tests/e2e/Services/GraphQL/FunctionsClientTest.php index 363f7a0fb1..3f0ee1966a 100644 --- a/tests/e2e/Services/GraphQL/FunctionsClientTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsClientTest.php @@ -82,7 +82,11 @@ class FunctionsClientTest extends Scope { $projectId = $this->getProject()['$id']; $query = $this->getQuery(self::$CREATE_DEPLOYMENT); - $code = realpath(__DIR__ . '/../../../resources/functions') . "/php/code.tar.gz"; + + $folder = 'php'; + $code = realpath(__DIR__ . '/../../../resources/functions') . "/$folder/code.tar.gz"; + $this->packageCode($folder); + $gqlPayload = [ 'operations' => \json_encode([ 'query' => $query, diff --git a/tests/e2e/Services/GraphQL/FunctionsServerTest.php b/tests/e2e/Services/GraphQL/FunctionsServerTest.php index 49a8fd61f2..25a671fa1c 100644 --- a/tests/e2e/Services/GraphQL/FunctionsServerTest.php +++ b/tests/e2e/Services/GraphQL/FunctionsServerTest.php @@ -81,7 +81,11 @@ class FunctionsServerTest extends Scope { $projectId = $this->getProject()['$id']; $query = $this->getQuery(self::$CREATE_DEPLOYMENT); - $code = realpath(__DIR__ . '/../../../resources/functions') . "/php/code.tar.gz"; + + $folder = 'php'; + $code = realpath(__DIR__ . '/../../../resources/functions') . "/$folder/code.tar.gz"; + $this->packageCode($folder); + $gqlPayload = [ 'operations' => \json_encode([ 'query' => $query, From a4c59b838a8c8357c978807465b54f8311aa795e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Thu, 26 Oct 2023 16:15:52 +0000 Subject: [PATCH 44/48] chore: remove commented files --- .github/workflows/tests.yml | 98 +++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d9d94e8434..d68bef11d1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,48 +14,34 @@ jobs: name: Setup & Build Appwrite Image runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: recursive + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - - name: Build Appwrite - uses: docker/build-push-action@v3 - 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: Build Appwrite + uses: docker/build-push-action@v3 + 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: Pull Docker Images - # run: docker compose pull --ignore-pull-failures --ignore-buildable - - # - name: List Files and images - # run: | - # docker compose config --images | sort -u - # docker save $(docker compose config --images | sort -u) -o /tmp/allinone.tar - - - name: Cache Docker Image - uses: actions/cache@v3 - with: - key: ${{ env.IMAGE }}-${{ github.sha }} - path: /tmp/${{ env.IMAGE }}.tar - - # - name: Upload Docker Image - # uses: actions/upload-artifact@v3 - # with: - # name: ${{ env.IMAGE }} - # path: /tmp/${{ env.IMAGE }}.tar + - name: Cache Docker Image + uses: actions/cache@v3 + with: + key: ${{ env.IMAGE }}-${{ github.sha }} + path: /tmp/${{ env.IMAGE }}.tar unit_test: name: Unit Test @@ -65,16 +51,16 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - + - name: Load Cache uses: actions/cache@v3 with: key: ${{ env.IMAGE }}-${{ github.sha }} path: /tmp/${{ env.IMAGE }}.tar fail-on-cache-miss: true - + - name: Load and Start Appwrite - run: | + run: | docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d sleep 10 @@ -83,10 +69,10 @@ jobs: run: docker compose exec -T appwrite doctor - name: Environment Variables - run: docker compose exec -T appwrite vars + run: docker compose exec -T appwrite vars - name: Run Unit Tests - run: docker compose exec appwrite test /usr/src/code/tests/unit + run: docker compose exec appwrite test /usr/src/code/tests/unit e2e_test: name: E2E Test @@ -95,7 +81,23 @@ jobs: strategy: fail-fast: false matrix: - services: [Account,Avatars,Console,Databases,Functions,GraphQL,Health,Locale,Projects,Realtime,Storage,Teams,Users,Webhooks] + services: + [ + Account, + Avatars, + Console, + Databases, + Functions, + GraphQL, + Health, + Locale, + Projects, + Realtime, + Storage, + Teams, + Users, + Webhooks, + ] steps: - name: checkout @@ -109,14 +111,14 @@ jobs: fail-on-cache-miss: true - name: Load and Start Appwrite - run: | + run: | docker load --input /tmp/${{ env.IMAGE }}.tar docker compose up -d sleep 10 - + - name: Run ${{matrix.services}} Tests run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug - name: Output build logs if: always() && ${{ matrix.services == 'GraphQL' }} - run: docker compose logs appwrite-worker-builds \ No newline at end of file + run: docker compose logs appwrite-worker-builds From 5d634384c8f6165a961378530909bd558350f200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Thu, 26 Oct 2023 16:24:14 +0000 Subject: [PATCH 45/48] chore: update CI --- .github/workflows/tests.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d68bef11d1..1ed5b6c0a2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,7 @@ concurrency: env: IMAGE: appwrite-dev + CACHE_KEY: ${{ env.IMAGE }}-${{ github.sha }} on: [pull_request] @@ -40,7 +41,7 @@ jobs: - name: Cache Docker Image uses: actions/cache@v3 with: - key: ${{ env.IMAGE }}-${{ github.sha }} + key: ${{ env.CACHE_KEY }} path: /tmp/${{ env.IMAGE }}.tar unit_test: @@ -55,7 +56,7 @@ jobs: - name: Load Cache uses: actions/cache@v3 with: - key: ${{ env.IMAGE }}-${{ github.sha }} + key: ${{ env.CACHE_KEY }} path: /tmp/${{ env.IMAGE }}.tar fail-on-cache-miss: true @@ -101,12 +102,12 @@ jobs: steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Load Cache uses: actions/cache@v3 with: - key: ${{ env.IMAGE }}-${{ github.sha }} + key: ${{ env.CACHE_KEY }} path: /tmp/${{ env.IMAGE }}.tar fail-on-cache-miss: true @@ -117,8 +118,4 @@ jobs: sleep 10 - name: Run ${{matrix.services}} Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug - - - name: Output build logs - if: always() && ${{ matrix.services == 'GraphQL' }} - run: docker compose logs appwrite-worker-builds + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file From c9c688c592246bc1f3f2ca38d65f476df3b0c151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Thu, 26 Oct 2023 16:26:13 +0000 Subject: [PATCH 46/48] chore: update CI --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1ed5b6c0a2..7c6f85cb29 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ concurrency: env: IMAGE: appwrite-dev - CACHE_KEY: ${{ env.IMAGE }}-${{ github.sha }} + CACHE_KEY: appwrite-dev-${{ github.sha }} on: [pull_request] @@ -82,7 +82,7 @@ jobs: strategy: fail-fast: false matrix: - services: + service: [ Account, Avatars, @@ -117,5 +117,5 @@ jobs: docker compose up -d sleep 10 - - name: Run ${{matrix.services}} Tests - run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.services}} --debug \ No newline at end of file + - name: Run ${{matrix.service}} Tests + run: docker compose exec -T appwrite test /usr/src/code/tests/e2e/Services/${{matrix.service}} --debug \ No newline at end of file From 09912592cf3ff959d4b6b32075603e87088ba456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Thu, 26 Oct 2023 16:27:57 +0000 Subject: [PATCH 47/48] chore: update CI --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c6f85cb29..6db2cdbdd3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,6 +15,8 @@ jobs: name: Setup & Build Appwrite Image runs-on: ubuntu-latest steps: + - name: Log + run: echo ${{ github.sha }} - name: Checkout repository uses: actions/checkout@v3 with: From c8788e2a131e66df4191425efc74416e10870b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=B7=E5=8D=8E=20=E5=88=98?= Date: Thu, 26 Oct 2023 16:43:50 +0000 Subject: [PATCH 48/48] chore: update CI --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6db2cdbdd3..ed9d7d1f19 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,7 @@ concurrency: env: IMAGE: appwrite-dev - CACHE_KEY: appwrite-dev-${{ github.sha }} + CACHE_KEY: appwrite-dev-${{ github.event.pull_request.head.sha }} on: [pull_request] @@ -15,8 +15,6 @@ jobs: name: Setup & Build Appwrite Image runs-on: ubuntu-latest steps: - - name: Log - run: echo ${{ github.sha }} - name: Checkout repository uses: actions/checkout@v3 with: