diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50547c6..2bccc56 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,6 +49,55 @@ jobs: done echo "Service is ready (returned 401)." + - name: Verify required apps are installed and ready + run: | + echo "Checking if required Nextcloud apps are installed and ready..." + + # Check Notes app + echo "Checking Notes app..." + max_attempts=30 + attempt=0 + until curl -u admin:admin -s -w "%{http_code}\n" -o /dev/null http://localhost:8080/apps/notes/api/v1/settings | grep -q "200"; do + attempt=$((attempt + 1)) + if [ $attempt -ge $max_attempts ]; then + echo "Notes app not ready after $max_attempts attempts." + exit 1 + fi + echo "Notes app attempt $attempt/$max_attempts: Not ready, sleeping for 3 seconds..." + sleep 3 + done + echo "Notes app is ready." + + # Check Tables app + echo "Checking Tables app..." + attempt=0 + until curl -u admin:admin -s -w "%{http_code}\n" -o /dev/null http://localhost:8080/ocs/v2.php/apps/tables/api/2/tables | grep -q "200"; do + attempt=$((attempt + 1)) + if [ $attempt -ge $max_attempts ]; then + echo "Tables app not ready after $max_attempts attempts." + exit 1 + fi + echo "Tables app attempt $attempt/$max_attempts: Not ready, sleeping for 3 seconds..." + sleep 3 + done + echo "Tables app is ready." + + # Check Calendar app (CalDAV endpoint) + echo "Checking Calendar app..." + attempt=0 + until curl -u admin:admin -s -w "%{http_code}\n" -o /dev/null -X PROPFIND http://localhost:8080/remote.php/dav/calendars/admin | grep -E "20[0-9]"; do + attempt=$((attempt + 1)) + if [ $attempt -ge $max_attempts ]; then + echo "Calendar app not ready after $max_attempts attempts." + exit 1 + fi + echo "Calendar app attempt $attempt/$max_attempts: Not ready, sleeping for 3 seconds..." + sleep 3 + done + echo "Calendar app is ready." + + echo "All required apps are installed and ready!" + # Add subsequent steps here, e.g., running tests - name: Run tests env: