diff --git a/.github/workflows/blossom-ci.yml b/.github/workflows/blossom-ci.yml index b380de0ea..000ff98f8 100644 --- a/.github/workflows/blossom-ci.yml +++ b/.github/workflows/blossom-ci.yml @@ -20,11 +20,11 @@ on: types: [created] workflow_dispatch: inputs: - platform: - description: 'runs-on argument' - required: false - args: - description: 'argument' + sha: + description: 'commit sha' + required: true + test_results_url: + description: 'test results url' required: false jobs: Authorization: @@ -35,7 +35,7 @@ jobs: # This job only runs for pull request comments if: | - github.event.comment.body == '/build' && (github.actor == 'niukuo' || github.actor == 'niukuo') + github.event.comment.body == '/build' && contains('["niukuo"]', github.actor) steps: - name: Check if comment is issued by authorized person run: blossom-ci @@ -78,14 +78,44 @@ jobs: CI_SERVER: ${{ secrets.CI_SERVER }} REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - Upload-Log: - name: Upload log - runs-on: blossom - if : github.event_name == 'workflow_dispatch' + Upload-Test: + name: Upload test results + runs-on: niukuo + if: github.event_name == 'workflow_dispatch' steps: - - name: Jenkins log for pull request ${{ fromJson(github.event.inputs.args).pr }} (click here) - run: blossom-ci - env: - OPERATION: 'POST-PROCESSING' - CI_SERVER: ${{ secrets.CI_SERVER }} - REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Collect test result + run: rm -rf results && mkdir results && cd results && curl -L ${{ github.event.inputs.test_results_url }} | tar -xz + - name: Create test summary + id: test_summary + uses: test-summary/action@dist + with: + paths: results/**/results*.xml + - name: Update success pr status + uses: actions/github-script@v6 + if: ${{ steps.test_summary.outputs.failed == 0 }} + with: + script: | + github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + context: 'blossom-ci', + sha: '${{ github.event.inputs.sha }}', + target_url: 'https://github.com/NVIDIA/TensorRT-LLM/actions/runs/' + context.runId, + state: 'success', + description: '${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }} tests passed', + }) + - name: Update failure pr status + uses: actions/github-script@v6 + if: ${{ steps.test_summary.outputs.failed != 0 }} + with: + script: | + github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + context: 'blossom-ci', + sha: '${{ github.event.inputs.sha }}', + target_url: 'https://github.com/NVIDIA/TensorRT-LLM/actions/runs/' + context.runId, + state: 'failure', + description: '${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }} tests failed', + }) + diff --git a/.github/workflows/blossom-test.yml b/.github/workflows/blossom-test.yml new file mode 100644 index 000000000..939473f01 --- /dev/null +++ b/.github/workflows/blossom-test.yml @@ -0,0 +1,57 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Blossom-Test +on: + workflow_dispatch: + inputs: + test_results_url: + description: 'test results url' + required: false + sha: + description: 'commit sha' + required: true +jobs: + Upload-Test: + name: Upload test results + runs-on: niukuo + if: github.event_name == 'workflow_dispatch' && false + steps: + - name: Collect test result + run: rm -rf results && mkdir results && cd results && curl -L ${{ github.event.inputs.test_results_url }} | tar -xz + - name: Jenkins log for commit ${{ github.event.inputs.sha }} (click here) + uses: mikepenz/action-junit-report@v5 + with: + report_paths: 'results/**/results*.xml' + include_passed: false + Update-Status: + name: Update test status + runs-on: ubuntu-latest + if: github.event_name == 'workflow_dispatch' + steps: + - name: Update pr status + id: set-result + uses: actions/github-script@v6 + with: + script: | + github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + context: 'blossom-ci', + sha: github.event.inputs.sha, + target_url: github.context.runId, + description: 'test done', + }) +