From 9586a21a5cc8c02fb8dd074cd5907c8502d563bb Mon Sep 17 00:00:00 2001 From: niukuo <6831097+niukuo@users.noreply.github.com> Date: Wed, 15 Jan 2025 22:20:26 -0800 Subject: [PATCH] ci test --- .github/workflows/blossom-ci.yml | 51 +++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/.github/workflows/blossom-ci.yml b/.github/workflows/blossom-ci.yml index b380de0ea..42a07875b 100644 --- a/.github/workflows/blossom-ci.yml +++ b/.github/workflows/blossom-ci.yml @@ -20,12 +20,15 @@ on: types: [created] workflow_dispatch: inputs: - platform: - description: 'runs-on argument' - required: false - args: - description: 'argument' - required: false + sha: + description: 'commit sha' + required: true + test_result: + description: 'test result' + required: true + test_results_url: + description: 'test results url' + required: true jobs: Authorization: name: Authorization @@ -35,7 +38,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 +81,28 @@ 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 commit status + 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: 'https://github.com/NVIDIA/TensorRT-LLM/actions/runs/' + context.runId, + state: '${{ steps.test_summary.outputs.failed > 0 && 'failure' || github.event.inputs.test_result || 'success' }}', + description: '${{ steps.test_summary.outputs.passed }} passed, ${{ steps.test_summary.outputs.failed }} failed, ${{ steps.test_summary.outputs.skipped }} skipped', + })