|
| 1 | +--- |
| 2 | +name: create reportportal launch |
| 3 | +description: create neuralmagic reportportal launch and return its ID |
| 4 | + |
| 5 | +inputs: |
| 6 | + reportportal_url: |
| 7 | + description: reportportal URL |
| 8 | + required: true |
| 9 | + reportportal_token: |
| 10 | + description: reportportal token |
| 11 | + required: true |
| 12 | + source: |
| 13 | + description: source for reportportal, e.g. 'build-test' |
| 14 | + required: true |
| 15 | + project_id: |
| 16 | + description: reportportal project id |
| 17 | + required: true |
| 18 | + run_name: |
| 19 | + description: run name |
| 20 | + required: false |
| 21 | + |
| 22 | +outputs: |
| 23 | + id: |
| 24 | + description: reportportal launch id |
| 25 | + value: ${{ steps.reportportal_create_launch_id.outputs.launch_id }} |
| 26 | + |
| 27 | +runs: |
| 28 | + using: composite |
| 29 | + steps: |
| 30 | + - name: create launch |
| 31 | + id: reportportal_create_launch_id |
| 32 | + run: | |
| 33 | + echo "creating reportportal launch ..." |
| 34 | + ## CHECK reportportal_url and token |
| 35 | + if [[ -z "${REPORTPORTAL_URL}" ]]; then |
| 36 | + echo "The REPORTPORTAL_URL secret is not defined for this repository" |
| 37 | + exit 1 |
| 38 | + fi |
| 39 | + if [[ -z "${REPORTPORTAL_TOKEN}" ]]; then |
| 40 | + echo "The REPORTPORTAL_TOKEN secret is not defined for this repository" |
| 41 | + exit 1 |
| 42 | + fi |
| 43 | + ## construct name |
| 44 | + REPORTPORTAL_RUN_NAME="${{ inputs.run_name }}" |
| 45 | + if [[ -z "${{ inputs.run_name }}" ]]; then |
| 46 | + BRANCH_NAME=${GITHUB_REF_NAME} |
| 47 | + TMP=${ACTOR}-${BRANCH_NAME} |
| 48 | + REPORTPORTAL_RUN_NAME=$(echo ${TMP} | awk '{print tolower($0)}') |
| 49 | + fi |
| 50 | + echo "test run name: ${REPORTPORTAL_RUN_NAME}" |
| 51 | + starttime=$(date -Iseconds) |
| 52 | +
|
| 53 | + ## construct launch request |
| 54 | + LAUNCH_ID = $(curl -L -X POST "${REPORTPORTAL_URL}/api/v1/plugin/${PROJECT_ID}/junit/import" \ |
| 55 | + -H "Content-Type: multipart/form-data" \ |
| 56 | + -H "Authorization: Bearer ${REPORTPORTAL_TOKEN}" \ |
| 57 | + -F 'file=@"file_path.zip";type=application/x-zip-compressed' \ |
| 58 | + -F 'launchImportRq="{ |
| 59 | + \"attributes\": [ |
| 60 | + { |
| 61 | + \"key\": \"skippedIsNotIssue\", |
| 62 | + \"system\": true, |
| 63 | + \"value\": \"true\" |
| 64 | + } |
| 65 | + ], |
| 66 | + \"description\": \"vllm tests\", |
| 67 | + \"mode\": \"DEFAULT\", |
| 68 | + \"name\": \"${REPORTPORTAL_RUN_NAME}\", |
| 69 | + \"startTime\": \"${starttime}\" |
| 70 | + }";type=application/json' | jq -r .id) |
| 71 | +
|
| 72 | + echo "launch_id=${LAUNCH_ID}" >> "${GITHUB_OUTPUT}" |
| 73 | + env: |
| 74 | + REPORTPORTAL_URL: ${{ inputs.reportportal_url }} |
| 75 | + REPORTPORTAL_TOKEN: ${{ inputs.reportportal_token }} |
| 76 | + PROJECT_ID: ${{ inputs.project_id }} |
| 77 | + shell: bash |
0 commit comments