|
| 1 | +name: report test results to reportportal |
| 2 | +run-name: ${{ github.actor }} report results for run ${{ inputs.run_id }} |
| 3 | +on: |
| 4 | + |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + label: |
| 8 | + description: "requested runner label (specifies instance)" |
| 9 | + type: string |
| 10 | + required: true |
| 11 | + timeout: |
| 12 | + description: "time limit for run in minutes " |
| 13 | + type: string |
| 14 | + required: true |
| 15 | + run_id: |
| 16 | + description: "run_id of 'build.yml' run that generated the assets" |
| 17 | + type: string |
| 18 | + required: true |
| 19 | + wheel: |
| 20 | + description: wheel used for testing |
| 21 | + type: string |
| 22 | + required: true |
| 23 | + run_name: |
| 24 | + description: name of the test run |
| 25 | + type: string |
| 26 | + required: true |
| 27 | + wf_category: |
| 28 | + description: "categories: NIGHTLY, RELEASE" |
| 29 | + type: string |
| 30 | + default: NIGHTLY |
| 31 | + gitref: |
| 32 | + description: "git commit hash or branch name" |
| 33 | + type: string |
| 34 | + default: main |
| 35 | + |
| 36 | + workflow_dispatch: |
| 37 | + inputs: |
| 38 | + label: |
| 39 | + description: "requested runner label (specifies instance)" |
| 40 | + type: string |
| 41 | + required: true |
| 42 | + timeout: |
| 43 | + description: "time limit for run in minutes " |
| 44 | + type: string |
| 45 | + required: true |
| 46 | + run_id: |
| 47 | + description: "run_id of 'build.yml' run that generated the assets" |
| 48 | + type: string |
| 49 | + required: true |
| 50 | + wheel: |
| 51 | + description: wheel used for testing |
| 52 | + type: string |
| 53 | + required: true |
| 54 | + run_name: |
| 55 | + description: name of the test run |
| 56 | + type: string |
| 57 | + required: true |
| 58 | + wf_category: |
| 59 | + description: "categories: NIGHTLY, RELEASE" |
| 60 | + type: string |
| 61 | + default: NIGHTLY |
| 62 | + gitref: |
| 63 | + description: "git commit hash or branch name" |
| 64 | + type: string |
| 65 | + default: main |
| 66 | + |
| 67 | +jobs: |
| 68 | + |
| 69 | + REPORT: |
| 70 | + runs-on: ${{ inputs.label }} |
| 71 | + timeout-minutes: ${{ fromJson(inputs.timeout) }} |
| 72 | + |
| 73 | + permissions: |
| 74 | + contents: 'read' |
| 75 | + id-token: 'write' |
| 76 | + |
| 77 | + steps: |
| 78 | + |
| 79 | + - name: checkout code |
| 80 | + id: checkout |
| 81 | + uses: actions/checkout@v4 |
| 82 | + with: |
| 83 | + ref: ${{ inputs.gitref }} |
| 84 | + |
| 85 | + - name: 'Authenticate to Google Cloud' |
| 86 | + id: auth-gcp |
| 87 | + uses: google-github-actions/auth@v2.1.3 |
| 88 | + with: |
| 89 | + project_id: ${{ secrets.GCP_PROJECT }} |
| 90 | + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} |
| 91 | + service_account: ${{ secrets.GCP_GHA_SA }} |
| 92 | + |
| 93 | + - name: 'Set up Cloud SDK' |
| 94 | + uses: 'google-github-actions/setup-gcloud@v2' |
| 95 | + with: |
| 96 | + version: '>= 473.0.0' |
| 97 | + |
| 98 | + - name: download assets |
| 99 | + uses: neuralmagic/nm-actions/actions/gcp-download-assets@v1.1.0 |
| 100 | + with: |
| 101 | + bucket_source: ${{ secrets.GCP_BUILD_ML_ASSETS2 }} |
| 102 | + run_id: ${{ inputs.run_id }} |
| 103 | + |
| 104 | + - name: generate metadata info |
| 105 | + id: generate-metadata |
| 106 | + run: | |
| 107 | + jq --raw-output -n '{ |
| 108 | + "hostname": "${{ secrets.REPORTPORTAL_HOST }}", |
| 109 | + "project": "compressed-tensors", |
| 110 | + "name": "${{ inputs.run_name }}", |
| 111 | + "description": "GitHub run: https://github.com/neuralmagic/compressed-tensors/actions/runs/${{ inputs.run_id }}", |
| 112 | + "attributes": [ |
| 113 | + {"key": "wheel", "value": "${{ inputs.wheel }}"}, |
| 114 | + {"key": "gitref", "value": "${{ inputs.gitref }}"}, |
| 115 | + {"key": "workflow category", "value": "${{ inputs.wf_category }}"} |
| 116 | + ] |
| 117 | + }' > metadata.json |
| 118 | + METADATA_FILEPATH=`realpath metadata.json` |
| 119 | + echo "metadata_filepath=${METADATA_FILEPATH}" | tee -a $GITHUB_OUTPUT |
| 120 | + shell: bash |
| 121 | + |
| 122 | + - name: report to reportportal |
| 123 | + uses: neuralmagic/nm-actions/actions/reportportal_submit_execution_results@v1.15.0 |
| 124 | + with: |
| 125 | + droute_username: ${{ secrets.DROUTE_USERNAME }} |
| 126 | + droute_password: ${{ secrets.DROUTE_PASSWORD }} |
| 127 | + droute_url: ${{ secrets.DROUTE_URL}} |
| 128 | + metadata_filepath: ${{ steps.generate-metadata.outputs.metadata_filepath }} |
0 commit comments