This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch add-nextcloud-test-for-webdav
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git

commit afaeecf357fba1c1b9b9cac488d44ff1fbba6656
Author: Xuanwo <[email protected]>
AuthorDate: Thu Jul 13 15:06:45 2023 +0800

    ci(services/webdav): Setup integration test for nextcloud
    
    Signed-off-by: Xuanwo <[email protected]>
---
 .github/workflows/service_test_webdav.yml | 59 +++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/.github/workflows/service_test_webdav.yml 
b/.github/workflows/service_test_webdav.yml
index 1d445c65f..2c40fa396 100644
--- a/.github/workflows/service_test_webdav.yml
+++ b/.github/workflows/service_test_webdav.yml
@@ -143,3 +143,62 @@ jobs:
         env:
           OPENDAL_WEBDAV_TEST: on
           OPENDAL_WEBDAV_ENDPOINT: http://127.0.0.1:8081
+
+  nextcloud:
+    runs-on: ubuntu-latest
+
+    services:
+      db:
+        image: mysql:5.7
+        env:
+          MYSQL_ROOT_PASSWORD: password
+          MYSQL_DATABASE: nextcloud
+          MYSQL_USER: nextcloud
+          MYSQL_PASSWORD: nextcloud
+        options: --health-cmd="mysqladmin ping" --health-interval=10s 
--health-timeout=5s --health-retries=5
+
+      nextcloud:
+        image: nextcloud
+        ports:
+          - 8080:80
+        env:
+          MYSQL_HOST: db
+          MYSQL_PASSWORD: nextcloud
+          MYSQL_DATABASE: nextcloud
+          MYSQL_USER: nextcloud
+          NEXTCLOUD_ADMIN_USER: admin
+          NEXTCLOUD_ADMIN_PASSWORD: admin
+        options: --health-cmd="curl -f http://localhost"; --health-interval=10s 
--health-timeout=5s --health-retries=5
+
+    steps:
+      - uses: actions/checkout@v3
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+        with:
+          need-nextest: true
+
+      - name: Wait for MySQL
+        run: |
+          for i in {1..30}; do
+            if echo 'SELECT 1' | mysql -h localhost -P 3306 -u nextcloud 
-pnextcloud nextcloud &> /dev/null; then
+              echo "MySQL is up!"
+              break
+            fi
+            echo "Waiting for MySQL..."
+            sleep 1
+          done
+
+      - name: Check online
+        run: |
+          curl http://localhost:8080
+
+      - name: Test with redirect
+        shell: bash
+        working-directory: core
+        run: |
+          cargo nextest run webdav
+        env:
+          OPENDAL_WEBDAV_TEST: on
+          OPENDAL_WEBDAV_ENDPOINT: http://127.0.0.1:8080/remote.php/webdav/
+          OPENDAL_WEBDAV_USERNAME: admin
+          OPENDAL_WEBDAV_PASSWORD: admin

Reply via email to