|
85 | 85 | with: |
86 | 86 | path: ${{ env.APP_ID }} |
87 | 87 |
|
88 | | - - name: Checkout AppAPI |
89 | | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
90 | | - with: |
91 | | - repository: cloud-py-api/app_api |
92 | | - path: apps/app_api |
93 | | - ref: v2.7.0 |
94 | | - |
95 | 88 | - name: Set up Nextcloud |
96 | 89 | if: ${{ matrix.databases != 'pgsql'}} |
97 | 90 | run: | |
@@ -146,19 +139,26 @@ jobs: |
146 | 139 | env: |
147 | 140 | CREDS: "admin:password" |
148 | 141 | run: | |
149 | | - TASK=$(curl -X POST -u "$CREDS" -H "oCS-APIRequest: true" -H "Content-type: application/json" http://localhost:8080/ocs/v2.php/taskprocessing/schedule?format=json --data-raw '{"input": {"input": "Hello World!"},"type":"core:text2text:translate", "appId": "test", "customId": ""}') |
| 142 | + set -x |
| 143 | + TASKTYPES=$(curl -s -u "$CREDS" -H "oCS-APIRequest: true" -H "Content-type: application/json" http://localhost:8080/ocs/v2.php/taskprocessing/tasktypes?format=json) |
| 144 | + echo $TASKTYPES |
| 145 | + [ "$(echo $TASKTYPES | jq -r '.ocs.meta.status')" == "OK" ] |
| 146 | +
|
| 147 | + TASK=$(curl -s -X POST -u "$CREDS" -H "oCS-APIRequest: true" -H "Content-type: application/json" http://localhost:8080/ocs/v2.php/taskprocessing/schedule?format=json --data-raw '{"input": {"input": "Hello World!", "origin_language": "auto", "target_language": "de"},"type":"core:text2text:translate", "appId": "test", "customId": ""}') |
150 | 148 | echo $TASK |
| 149 | + [ "$(echo $TASK | jq -r '.ocs.meta.status')" == "OK" ] |
| 150 | +
|
151 | 151 | TASK_ID=$(echo $TASK | jq '.ocs.data.task.id') |
152 | 152 | NEXT_WAIT_TIME=0 |
153 | 153 | TASK_STATUS='"STATUS_SCHEDULED"' |
154 | 154 | until [ $NEXT_WAIT_TIME -eq 35 ] || [ "$TASK_STATUS" == '"STATUS_SUCCESSFUL"' ] || [ "$TASK_STATUS" == '"STATUS_FAILED"' ]; do |
155 | | - TASK=$(curl -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json) |
| 155 | + TASK=$(curl -s -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json) |
156 | 156 | echo $TASK |
157 | 157 | TASK_STATUS=$(echo $TASK | jq '.ocs.data.task.status') |
158 | 158 | echo $TASK_STATUS |
159 | 159 | sleep $(( NEXT_WAIT_TIME++ )) |
160 | 160 | done |
161 | | - curl -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json |
| 161 | + curl -s -u "$CREDS" -H "oCS-APIRequest: true" http://localhost:8080/ocs/v2.php/taskprocessing/task/$TASK_ID?format=json |
162 | 162 | [ "$TASK_STATUS" == '"STATUS_SUCCESSFUL"' ] |
163 | 163 | [ "$(echo $TASK | jq '.ocs.data.task.output')" == '"Hallo Welt!"' ] |
164 | 164 |
|
|
0 commit comments